diff options
author | Ren Zhijie <renzhijie2@huawei.com> | 2022-06-09 14:04:48 +0200 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2022-07-13 17:38:20 +0200 |
commit | 0356d778aa1e14d80db40a9dae02192d6b47a5ac (patch) | |
tree | b472581f95ec04ad9ce49f51803d4aedd392870c /drivers/hwmon | |
parent | hwmon: (lm90) Read the channel's temperature offset from device-tree (diff) | |
download | linux-0356d778aa1e14d80db40a9dae02192d6b47a5ac.tar.xz linux-0356d778aa1e14d80db40a9dae02192d6b47a5ac.zip |
hwmon: (pmbus) fix build error unused-function
If CONFIG_PMBUS is y and CONFIG_DEBUG_FS is not set.
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-, will be failed, like this:
drivers/hwmon/pmbus/pmbus_core.c:593:13: error: ‘pmbus_check_block_register’ defined but not used [-Werror=unused-function]
static bool pmbus_check_block_register(struct i2c_client *client, int page,
^~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[3]: *** [drivers/hwmon/pmbus/pmbus_core.o] Error 1
make[2]: *** [drivers/hwmon/pmbus] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [drivers/hwmon] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [drivers] Error 2
To fix building warning, use __maybe_unused to attach this func.
Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: c3ffc3a1ff83("hwmon: (pmbus) add a function to check the presence of a block register")
Signed-off-by: Ren Zhijie <renzhijie2@huawei.com>
Link: https://lore.kernel.org/r/20220609120448.139907-1-renzhijie2@huawei.com
[groeck: Fixed continuation line alignment]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/pmbus/pmbus_core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c index 809e666cb52b..4187dc20d2aa 100644 --- a/drivers/hwmon/pmbus/pmbus_core.c +++ b/drivers/hwmon/pmbus/pmbus_core.c @@ -590,8 +590,8 @@ bool pmbus_check_word_register(struct i2c_client *client, int page, int reg) } EXPORT_SYMBOL_NS_GPL(pmbus_check_word_register, PMBUS); -static bool pmbus_check_block_register(struct i2c_client *client, int page, - int reg) +static bool __maybe_unused pmbus_check_block_register(struct i2c_client *client, + int page, int reg) { int rv; struct pmbus_data *data = i2c_get_clientdata(client); |