From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Ian Abbott <abbotti@mev.co.uk>
Cc: linux-kernel@vger.kernel.org,
H Hartley Sweeten <hsweeten@visionengravers.com>,
Mirsad Todorovac <mtodorovac69@gmail.com>
Subject: Re: [PATCH] staging: comedi: ni_*: do not declare unused variable range_ni_E_ao_ext
Date: Wed, 10 Jul 2024 19:51:08 +0200 [thread overview]
Message-ID: <2024071043-cramp-pope-2133@gregkh> (raw)
In-Reply-To: <20240710173719.3559437-1-abbotti@mev.co.uk>
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@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>
> ---
> 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
prev parent reply other threads:[~2024-07-10 17:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-10 17:37 Ian Abbott
2024-07-10 17:51 ` Greg Kroah-Hartman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2024071043-cramp-pope-2133@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=abbotti@mev.co.uk \
--cc=hsweeten@visionengravers.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mtodorovac69@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®