linux/drivers/comedi
Ian Abbott 4d41a49c46 comedi: ni_*: do not declare unused variable range_ni_E_ao_ext
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@gmail.com>
Link: https://lore.kernel.org/lkml/3bab8580-c01a-4183-94af-ba3193c94c0e@gmail.com/
Cc: Mirsad Todorovac <mtodorovac69@gmail.com>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://lore.kernel.org/r/20240710173719.3559437-1-abbotti@mev.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-07-31 13:11:43 +02:00
..
drivers comedi: ni_*: do not declare unused variable range_ni_E_ao_ext 2024-07-31 13:11:43 +02:00
kcomedilib comedi: Move the main COMEDI headers 2021-11-26 16:48:59 +01:00
comedi_buf.c comedi: Move the main COMEDI headers 2021-11-26 16:48:59 +01:00
comedi_fops.c drivers/comedi: use standard array-copy-function 2023-12-07 11:08:45 +09:00
comedi_internal.h
comedi_pci.c comedi: Move the main COMEDI headers 2021-11-26 16:48:59 +01:00
comedi_pcmcia.c comedi: Move the main COMEDI headers 2021-11-26 16:48:59 +01:00
comedi_usb.c comedi: Move the main COMEDI headers 2021-11-26 16:48:59 +01:00
drivers.c comedi: comedi_8254: Replace comedi_8254_init() and comedi_8254_mm_init() 2023-10-05 13:34:04 +02:00
Kconfig comedi: add HAS_IOPORT dependencies again 2023-10-05 13:34:05 +02:00
Makefile
proc.c comedi: Move the main COMEDI headers 2021-11-26 16:48:59 +01:00
range.c comedi: Move the main COMEDI headers 2021-11-26 16:48:59 +01:00
TODO