[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2024071043-cramp-pope-2133@gregkh>
Date: Wed, 10 Jul 2024 19:51:08 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Ian Abbott <abbotti@....co.uk>
Cc: linux-kernel@...r.kernel.org,
H Hartley Sweeten <hsweeten@...ionengravers.com>,
Mirsad Todorovac <mtodorovac69@...il.com>
Subject: Re: [PATCH] staging: comedi: ni_*: do not declare unused variable
range_ni_E_ao_ext
On Wed, Jul 10, 2024 at 06:37:19PM +0100, Ian Abbott wrote:
> Mirsad Todorovac reported a compiler warning in "ni_stc.h" due to the
> variable `range_ni_E_ao_ext` being defined but unused when building the
> "ni_routes_test" module.
>
> The `range_ni_E_ao_ext` variable is tentatively defined in "ni_stc.h"
> (with internal linkage) and fully defined in "ni_mio_common.c".
> "ni_stc.h" and/or "ni_mio_common.c" are included by the "ni_atmio",
> "ni_pcimio", "ni_mio_cs", and "ni_routes_test" modules, which will each
> get their own local `range_ni_E_ao_ext` variable defined. However, it
> is not used by the "ni_mio_cs" or "ni_routes_test" modules. They should
> get optimized out, but there are compiler warnings about the unused
> variable when built with the `W=1` option.
>
> Move the full definition of the variable from "ni_mio_common.c" into the
> places where it is used, namely "ni_atmio.c" and "ni_pcimio.c", and
> remove the tentative definition of the variable from "ni_stc.h". This
> fixes the compiler warnings.
>
> Reported-by: Mirsad Todorovac <mtodorovac69@...il.com>
> Link: https://lore.kernel.org/lkml/3bab8580-c01a-4183-94af-ba3193c94c0e@gmail.com/
> Cc: Mirsad Todorovac <mtodorovac69@...il.com>
> Signed-off-by: Ian Abbott <abbotti@....co.uk>
> ---
> Note: The linked report also covers similar warnings elsewhere in the
> kernel, so is not closed by this patch.
Nit, no need for "staging:" in the subject line anymore :)
I'll fix that up when applying it, no need to resend.
thanks,
greg k-h
Powered by blists - more mailing lists