public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Hans de Goede <hdegoede@redhat.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	linux-iio@vger.kernel.org, kernel test robot <lkp@intel.com>
Subject: [PATCH] iio: mma8452: Fix 'mma8452_dt_ids' defined but not used compiler warning
Date: Mon, 14 Feb 2022 10:18:50 +0100	[thread overview]
Message-ID: <20220214091850.44139-1-hdegoede@redhat.com> (raw)

Commit 90adc57bd55a ("iio: mma8452: Fix probe failing when an
i2c_device_id is used") introduces a new: "'mma8452_dt_ids' defined
but not used" compiler warning.

This is caused by the switch from of_match_device() (which takes a
pointer to this) to device_get_match_data(), combined with the use of
of_match_ptr() when setting of_match_table.

We actually want mma8452_dt_ids to get optmized away when CONFIG_OF is
not set, so mark it as __maybe_unused to silence the warning.

Fixes: 90adc57bd55a ("iio: mma8452: Fix probe failing when an i2c_device_id is used")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Note the 90adc57bd55a hash is from the jic23/iio.git testing branch, not
sure of it is stable. It is probably best to just squash this into the
original commit.
---
 drivers/iio/accel/mma8452.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
index 590d9431e1bd..1324bd515377 100644
--- a/drivers/iio/accel/mma8452.c
+++ b/drivers/iio/accel/mma8452.c
@@ -1529,7 +1529,7 @@ static int mma8452_reset(struct i2c_client *client)
 	return -ETIMEDOUT;
 }
 
-static const struct of_device_id mma8452_dt_ids[] = {
+static const struct of_device_id __maybe_unused mma8452_dt_ids[] = {
 	{ .compatible = "fsl,mma8451", .data = &mma_chip_info_table[mma8451] },
 	{ .compatible = "fsl,mma8452", .data = &mma_chip_info_table[mma8452] },
 	{ .compatible = "fsl,mma8453", .data = &mma_chip_info_table[mma8453] },
-- 
2.33.1


             reply	other threads:[~2022-02-14  9:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-14  9:18 Hans de Goede [this message]
2022-02-14 10:54 ` [PATCH] iio: mma8452: Fix 'mma8452_dt_ids' defined but not used compiler warning Jonathan Cameron
2022-02-14 10:59   ` Hans de Goede
2022-02-18 11:30     ` Jonathan Cameron

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=20220214091850.44139-1-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=lkp@intel.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