[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CH2PR12MB3895C3FA56AE40EA043A0BCAD7209@CH2PR12MB3895.namprd12.prod.outlook.com>
Date: Mon, 10 Oct 2022 12:00:09 +0000
From: Asmaa Mnebhi <asmaa@...dia.com>
To: Ren Zhijie <renzhijie2@...wei.com>,
Khalil Blaiech <kblaiech@...dia.com>,
Vadim Pasternak <vadimp@...dia.com>,
"wsa@...nel.org" <wsa@...nel.org>
CC: "linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH -next] i2c: mlxbf: Fix unused-variable warning
Acked-by: Asmaa Mnebhi
-----Original Message-----
From: Ren Zhijie <renzhijie2@...wei.com>
Sent: Sunday, October 9, 2022 9:38 AM
To: Khalil Blaiech <kblaiech@...dia.com>; Asmaa Mnebhi <asmaa@...dia.com>; Vadim Pasternak <vadimp@...dia.com>; wsa@...nel.org
Cc: linux-i2c@...r.kernel.org; linux-kernel@...r.kernel.org; Ren Zhijie <renzhijie2@...wei.com>
Subject: [PATCH -next] i2c: mlxbf: Fix unused-variable warning
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@...wei.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
Powered by blists - more mailing lists