hwmon: hp-wmi-sensors: fix debugfs check
Subsystems (2)
PATCH 1/1 hwmon: hp-wmi-sensors: fix debugfs check
From: Arnd Bergmann <[email protected]>
Checking for Kconfig symbols with #if is wrong:
drivers/hwmon/hp-wmi-sensors.c:1141:5: error: "CONFIG_DEBUG_FS" is not defined, evaluates to 0 [-Werror=undef]
This could be an #ifdef, but an IS_ENABLED() check is even better to give the best compile coverage.
--- drivers/hwmon/hp-wmi-sensors.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-)
drivers/hwmon/hp-wmi-sensors.c +2 -13
@@ -1138,8 +1138,6 @@ static int hp_wmi_update_info(struct hp_wmi_sensors *state,return ret; } -#if CONFIG_DEBUG_FS -static int basic_string_show (struct seq_file *seqf,void *ignored) {const char *str = seqf->private;
@@ -1341,16 +1339,6 @@ static void hp_wmi_debugfs_init(struct device *dev, struct hp_wmi_info *info, } } -#else - -static void hp_wmi_debugfs_init (struct device *dev,struct hp_wmi_info *info, -struct hp_wmi_platform_events *pevents, -u8 icount,u8 pcount,bool is_new) -{ -} - -#endif -static umode_t hp_wmi_hwmon_is_visible (const void *drvdata,enum hwmon_sensor_types type,u32 attr,int channel)
@@ -1959,7 +1947,8 @@ static int hp_wmi_sensors_init(struct hp_wmi_sensors *state)if (err)return err; -hp_wmi_debugfs_init (dev, info, pevents, icount, pcount, is_new); +if (IS_ENABLED (CONFIG_DEBUG_FS )) +hp_wmi_debugfs_init (dev, info, pevents, icount, pcount, is_new);if (!count)return 0 ;/* No connected sensors; debugfs only. */
Signature · 1 line
2.39.2
Quoted 58 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
Checking for
Kconfigsymbols with #if is wrong:
drivers/hwmon/hp-wmi-sensors.c:1141:5: error: "CONFIG_DEBUG_FS" is not defined, evaluates to 0 [-Werror=undef]This could be an #ifdef, but an
IS_ENABLED()check is even better to give the best compile coverage.Fixes 602bef0fa281f ("hwmon: add HP WMI Sensors driver")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/hwmon/hp-wmi-sensors.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-)drivers/hwmon/hp-wmi-sensors.c +2
-13@@ -1138,8 +1138,6 @@ static int hp_wmi_update_info(struct hp_wmi_sensors *state,return ret; } -#if CONFIG_DEBUG_FS -static int basic_string_show (struct seq_file *seqf,void *ignored) {const char *str = seqf->private;@@ -1341,16 +1339,6 @@ static void hp_wmi_debugfs_init(struct device *dev, struct hp_wmi_info *info, } } -#else - -static void hp_wmi_debugfs_init (struct device *dev,struct hp_wmi_info *info, -struct hp_wmi_platform_events *pevents, -u8 icount,u8 pcount,bool is_new) -{ -} - -#endif -static umode_t hp_wmi_hwmon_is_visible (const void *drvdata,enum hwmon_sensor_types type,u32 attr,int channel)@@ -1959,7 +1947,8 @@ static int hp_wmi_sensors_init(struct hp_wmi_sensors *state)if (err)return err; -hp_wmi_debugfs_init (dev, info, pevents, icount, pcount, is_new); +if (IS_ENABLED (CONFIG_DEBUG_FS )) +hp_wmi_debugfs_init (dev, info, pevents, icount, pcount, is_new);if (!count)return 0 ;/* No connected sensors; debugfs only. */ Signature · 1 line
2.39.2
Quoted 4 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
Checking for
Kconfigsymbols with #if is wrong:
Quoted 8 lines
drivers/hwmon/hp-wmi-sensors.c:1141:5: error: "CONFIG_DEBUG_FS" is not defined, evaluates to 0 [-Werror=undef]This could be an #ifdef, but an
IS_ENABLED()check is even better to give the best compile coverage.Fixes 602bef0fa281 ("hwmon: add HP WMI Sensors driver")Signed-off-by Arnd Bergmann <[email protected]>Acked-by James Seo <[email protected]>
Applied.
Thanks,
Guenter
Quoted 44 lines
--- drivers/hwmon/hp-wmi-sensors.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-)drivers/hwmon/hp-wmi-sensors.c +2
-13@@ -1138,8 +1138,6 @@ static int hp_wmi_update_info(struct hp_wmi_sensors *state,return ret; } -#if CONFIG_DEBUG_FS -static int basic_string_show (struct seq_file *seqf,void *ignored) {const char *str = seqf->private;@@ -1341,16 +1339,6 @@ static void hp_wmi_debugfs_init(struct device *dev, struct hp_wmi_info *info, } } -#else - -static void hp_wmi_debugfs_init (struct device *dev,struct hp_wmi_info *info, -struct hp_wmi_platform_events *pevents, -u8 icount,u8 pcount,bool is_new) -{ -} - -#endif -static umode_t hp_wmi_hwmon_is_visible (const void *drvdata,enum hwmon_sensor_types type,u32 attr,int channel)@@ -1959,7 +1947,8 @@ static int hp_wmi_sensors_init(struct hp_wmi_sensors *state)if (err)return err; -hp_wmi_debugfs_init (dev, info, pevents, icount, pcount, is_new); +if (IS_ENABLED (CONFIG_DEBUG_FS )) +hp_wmi_debugfs_init (dev, info, pevents, icount, pcount, is_new);if (!count)return 0 ;/* No connected sensors; debugfs only. */