From: Ren Zhijie <renzhijie2@huawei.com>
To: <kblaiech@nvidia.com>, <asmaa@nvidia.com>, <vadimp@mellanox.com>,
<wsa@kernel.org>
Cc: <linux-i2c@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Ren Zhijie <renzhijie2@huawei.com>
Subject: [PATCH -next] i2c: mlxbf: Fix unused-variable warning
Date: Sun, 9 Oct 2022 13:38:22 +0000 [thread overview]
Message-ID: <20221009133822.254122-1-renzhijie2@huawei.com> (raw)
If CONFIG_ACPI is not set,
gcc warns about unused variable:
drivers/i2c/busses/i2c-mlxbf.c:2206:35: error: ‘mlxbf_i2c_chip’ defined but not used [-Werror=unused-variable]
static struct mlxbf_i2c_chip_info mlxbf_i2c_chip[] = {
^~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Mark these variables as __maybe_unused to fix this.
Fixes: b5b5b32081cd ("i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC")
Signed-off-by: Ren Zhijie <renzhijie2@huawei.com>
---
drivers/i2c/busses/i2c-mlxbf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c
index e68e775f187e..087df1a53797 100644
--- a/drivers/i2c/busses/i2c-mlxbf.c
+++ b/drivers/i2c/busses/i2c-mlxbf.c
@@ -2203,7 +2203,7 @@ static u32 mlxbf_i2c_functionality(struct i2c_adapter *adap)
return MLXBF_I2C_FUNC_ALL;
}
-static struct mlxbf_i2c_chip_info mlxbf_i2c_chip[] = {
+static struct mlxbf_i2c_chip_info __maybe_unused mlxbf_i2c_chip[] = {
[MLXBF_I2C_CHIP_TYPE_1] = {
.type = MLXBF_I2C_CHIP_TYPE_1,
.shared_res = {
--
2.17.1
next reply other threads:[~2022-10-09 13:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-09 13:38 Ren Zhijie [this message]
2022-10-10 12:00 ` [PATCH -next] i2c: mlxbf: Fix unused-variable warning Asmaa Mnebhi
2022-10-19 19:44 ` wsa
2022-10-21 6:46 ` wsa
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=20221009133822.254122-1-renzhijie2@huawei.com \
--to=renzhijie2@huawei.com \
--cc=asmaa@nvidia.com \
--cc=kblaiech@nvidia.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vadimp@mellanox.com \
--cc=wsa@kernel.org \
/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