diff options
author | Ian Abbott <[email protected]> | 2024-07-10 18:37:19 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2024-07-31 13:11:43 +0200 |
commit | 4d41a49c4660eca5214d8b6f85cc8569c7d77599 (patch) | |
tree | cc15640e58ebe4bf98e9e4ad132274297618986f /lib/test_fortify/write_overflow-strncpy.c | |
parent | 8400291e289ee6b2bf9779ff1c83a291501f017b (diff) |
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 <[email protected]>
Link: https://lore.kernel.org/lkml/[email protected]/
Cc: Mirsad Todorovac <[email protected]>
Signed-off-by: Ian Abbott <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy.c')
0 files changed, 0 insertions, 0 deletions