[Intel-gfx] [PATCH 10/15] drm/i915/gem: annotate maybe unused but set variable c
Andi Shyti
andi.shyti at linux.intel.com
Fri May 26 17:50:25 UTC 2023
Hi Jani,
On Fri, May 26, 2023 at 07:38:03PM +0300, Jani Nikula wrote:
> Prepare for re-enabling -Wunused-but-set-variable.
>
> The variable 'c' appears unused, but I'm not sure what should be done
> with it. Annotate it with __maybe_unused.
>
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
> ---
> drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
> index cad4a6017f4b..33d5d5178103 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
> @@ -455,7 +455,7 @@ shmem_pwrite(struct drm_i915_gem_object *obj,
> struct page *page;
> void *data, *vaddr;
> int err;
> - char c;
> + char __maybe_unused c;
Yes... it's only initialized... maybe we need to come out with a
version of __get_user() that doesn't need 'c'. I think the
__maybe_unused fits good here.
Reviewed-by: Andi Shyti <andi.shyti at linux.intel.com>
Andi
>
> len = PAGE_SIZE - pg;
> if (len > remain)
> --
> 2.39.2
More information about the Intel-gfx
mailing list