From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>,
linux-iio@vger.kernel.org, Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Subject: Re: [PATCH v1 1/3] iio: st_lsm6dsx: Mark predefined constants with __maybe_unused
Date: Mon, 23 Dec 2019 16:10:01 +0000 [thread overview]
Message-ID: <20191223161001.015d2afe@archlinux> (raw)
In-Reply-To: <20191216181925.927-1-andriy.shevchenko@linux.intel.com>
On Mon, 16 Dec 2019 20:19:23 +0200
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> Since we put static variable to a header file it's copied to each module
> that includes the header. But not all of them are actually used it.
>
> Mark predefined constants with __maybe_unused to calm a compiler down:
>
> In file included from drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c:17:
> .../st_lsm6dsx/st_lsm6dsx.h:399:28: warning: ‘st_lsm6dsx_available_scan_masks’ defined but not used [-Wunused-const-variable=]
> 399 | static const unsigned long st_lsm6dsx_available_scan_masks[] = {0x7, 0x0};
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> .../st_lsm6dsx/st_lsm6dsx.h:392:36: warning: ‘st_lsm6dsx_event’ defined but not used [-Wunused-const-variable=]
> 392 | static const struct iio_event_spec st_lsm6dsx_event = {
> | ^~~~~~~~~~~~~~~~
> ...
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Huh, I wonder we I never saw this one either locally or from the autobuilders.
Applied to the togreg branch of iio.git and pushed out as testing for the
autobuilders to have a fun Christmas poking at it ;)
Thanks,
Jonathan
> ---
> drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> index dc55d7dff3eb..b3fbbae81955 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> @@ -389,14 +389,17 @@ struct st_lsm6dsx_hw {
> const struct st_lsm6dsx_settings *settings;
> };
>
> -static const struct iio_event_spec st_lsm6dsx_event = {
> +static __maybe_unused const struct iio_event_spec st_lsm6dsx_event = {
> .type = IIO_EV_TYPE_THRESH,
> .dir = IIO_EV_DIR_EITHER,
> .mask_separate = BIT(IIO_EV_INFO_VALUE) |
> BIT(IIO_EV_INFO_ENABLE)
> };
>
> -static const unsigned long st_lsm6dsx_available_scan_masks[] = {0x7, 0x0};
> +static __maybe_unused const unsigned long st_lsm6dsx_available_scan_masks[] = {
> + 0x7, 0x0,
> +};
> +
> extern const struct dev_pm_ops st_lsm6dsx_pm_ops;
>
> int st_lsm6dsx_probe(struct device *dev, int irq, int hw_id,
prev parent reply other threads:[~2019-12-23 16:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-16 18:19 [PATCH v1 1/3] iio: st_lsm6dsx: Mark predefined constants with __maybe_unused Andy Shevchenko
2019-12-16 18:19 ` [PATCH v1 2/3] iio: st_lsm6dsx: Drop unneeded OF code Andy Shevchenko
2019-12-23 16:11 ` Jonathan Cameron
2019-12-16 18:19 ` [PATCH v1 3/3] iio: st_lsm6dsx: Make use of device properties Andy Shevchenko
2019-12-23 16:14 ` Jonathan Cameron
2019-12-23 16:10 ` Jonathan Cameron [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=20191223161001.015d2afe@archlinux \
--to=jic23@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=lorenzo.bianconi83@gmail.com \
--cc=pmeerw@pmeerw.net \
/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