[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <25f8e66c-09e8-f5d8-e3d5-ec48fbd8287d@gmx.de>
Date: Tue, 30 Nov 2021 11:13:52 +0100
From: Helge Deller <deller@....de>
To: Thomas Zimmermann <tzimmermann@...e.de>, airlied@...ux.ie,
daniel.vetter@...ll.ch, arnd@...db.de, gregkh@...uxfoundation.org,
James.Bottomley@...senPartnership.com
Cc: dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/7] agp/nvidia: Ignore value returned by readl()
On 11/12/21 15:16, Thomas Zimmermann wrote:
> Fix the compiler warning
>
> drivers/char/agp/nvidia-agp.c: In function 'nvidia_tlbflush':
> drivers/char/agp/nvidia-agp.c:264:22: warning: variable 'temp' set but not used [-Wunused-but-set-variable]
> 264 | u32 wbc_reg, temp;
>
> by removing the unused variable. The affected readl() is only
> required for flushing caches, but the returned value is not of
> interest.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@...e.de>
> ---
> drivers/char/agp/nvidia-agp.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c
> index f78e756157db..437b3581cbe5 100644
> --- a/drivers/char/agp/nvidia-agp.c
> +++ b/drivers/char/agp/nvidia-agp.c
> @@ -261,7 +261,7 @@ static int nvidia_remove_memory(struct agp_memory *mem, off_t pg_start, int type
> static void nvidia_tlbflush(struct agp_memory *mem)
> {
> unsigned long end;
> - u32 wbc_reg, temp;
> + u32 wbc_reg;
> int i;
>
> /* flush chipset */
> @@ -283,9 +283,9 @@ static void nvidia_tlbflush(struct agp_memory *mem)
>
> /* flush TLB entries */
> for (i = 0; i < 32 + 1; i++)
> - temp = readl(nvidia_private.aperture+(i * PAGE_SIZE / sizeof(u32)));
> + (void)readl(nvidia_private.aperture+(i * PAGE_SIZE / sizeof(u32)));
IMHO the void is ugly.
Would tagging temp with "__maybe_unused" work ?
Helge
> for (i = 0; i < 32 + 1; i++)
> - temp = readl(nvidia_private.aperture+(i * PAGE_SIZE / sizeof(u32)));
> + (void)readl(nvidia_private.aperture+(i * PAGE_SIZE / sizeof(u32)));
> }
>
>
>
Powered by blists - more mailing lists