[Intel-gfx] [PATCH] drm/i915: avoid rebuilding i915_gpu_error.o on version string updates

Chris Wilson chris at chris-wilson.co.uk
Wed Nov 21 10:16:28 UTC 2018


Quoting Hans Holmberg (2018-11-21 09:54:23)
> From: Hans Holmberg <hans.holmberg at cnexlabs.com>
> 
> There is no need to rebuild i915_gpu_error.o when the version string
> changes as the version is available in init_utsname()->release.
> 
> Signed-off-by: Hans Holmberg <hans.holmberg at cnexlabs.com>
> ---
>  drivers/gpu/drm/i915/i915_gpu_error.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> index 8762d17b6659..958e1484a3dd 100644
> --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -27,7 +27,7 @@
>   *
>   */
>  
> -#include <generated/utsrelease.h>
> +#include <linux/utsname.h>
>  #include <linux/stop_machine.h>
>  #include <linux/zlib.h>
>  #include <drm/drm_print.h>
> @@ -650,7 +650,7 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
>  
>         if (*error->error_msg)
>                 err_printf(m, "%s\n", error->error_msg);
> -       err_printf(m, "Kernel: " UTS_RELEASE "\n");
> +       err_printf(m, "Kernel: %s\n", init_utsname()->release);

Should we take some more info from init_utsname, plagiarising
dump_stack,

	err_printf(m, :Kernel: %s %.*s\n",
		   init_utsname()->release,
		   (int)strcspn(init_utsname()->version, " "),
		   init_utsname()->version);

-Chris


More information about the Intel-gfx mailing list