fix unused variable warning
PATCH 1/1 fix unused variable warning
[thermal] fix unused variable warning
thermal_event_seqnum is only used if CONFIG_NET is defined.
--- drivers/thermal/thermal_sys.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
---
drivers/thermal/thermal_sys.c +2 -0
@@ -60,7 +60,9 @@ static LIST_HEAD(thermal_tz_list);static LIST_HEAD (thermal_cdev_list);static DEFINE_MUTEX (thermal_list_lock); +#ifdef CONFIG_NET static unsigned int thermal_event_seqnum; +#endif /* CONFIG_NET */ static int get_idr (struct idr *idr,struct mutex *lock,int *id) {
Hi Daniel,
Quoted 14 lines · Daniel Walter
[thermal] fix unused variable warning
thermal_event_seqnumis only used ifCONFIG_NETis defined.Signed-off-by Daniel Walter <[email protected]>---
drivers/thermal/thermal_sys.c | 2 ++1 files changed, 2 insertions(+), 0 deletions(-)---
drivers/thermal/thermal_sys.c +0
-0
drivers/thermal/thermal_sys.c static LIST_HEAD(thermal_tz_list); · line 66
Quoted 7 lines
drivers/thermal/thermal_sys.c +2
-0@@ -60,7 +60,9 @@ static LIST_HEAD(thermal_tz_list); static LIST_HEAD(thermal_cdev_list); static DEFINE_MUTEX(thermal_list_lock); +#ifdef CONFIG_NET static unsigned int thermal_event_seqnum; +#endif /* CONFIG_NET */
I think, it would be nice to move thermal_event_seqnum under CONFIG_NET defined section, instead of wrapping with CONFIG_NET. Although your fix is okay but moving under CONFIG_NET would be nicer. Something like below:
---
drivers/thermal/thermal_sys.c +0 -2
@@ -60,8 +60,6 @@ static LIST_HEAD(thermal_tz_list);static LIST_HEAD (thermal_cdev_list);static DEFINE_MUTEX (thermal_list_lock); -static unsigned int thermal_event_seqnum; -static int get_idr (struct idr *idr,struct mutex *lock,int *id) {int err;
@@ -1293,6 +1291,8 @@ void thermal_zone_device_unregister(struct
thermal_zone_device *tz)
EXPORT_SYMBOL(thermal_zone_device_unregister);
#ifdef CONFIG_NET
+static unsigned int thermal_event_seqnum;
+
static struct genl_family thermal_event_genl_family = {
.id = GENL_ID_GENERATE,
.name = THERMAL_GENL_FAMILY_NAME,
Thanks,
Rakib