thermal: thermal_sys: Fix build warning
PATCH 1/1 thermal: thermal_sys: Fix build warning
Fix the following build warning:
drivers/thermal/thermal_sys.c:63: warning: 'thermal_event_seqnum' defined but not used
,which happens when CONFIG_NET is not set.
Move 'thermal_event_seqnum' definition inside the '#ifdef CONFIG_NET'
--- drivers/thermal/thermal_sys.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/thermal/thermal_sys.c +2 -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 intC; -static int get_idr (struct idr *idr,struct mutex *lock,int *id) {int err;
@@ -1304,6 +1302,8 @@ static struct genl_multicast_group thermal_event_mcgrp = { .name = THERMAL_GENL_MCAST_GROUP_NAME, }; +static unsigned int thermal_event_seqnum; +int generate_netlink_event (u32 orig,enum events event) {struct sk_buff *skb;
Signature · 1 line
1.7.1
PATCH v2 1/1 thermal: thermal_sys: Fix build warning
Fix the following build warning:
drivers/thermal/thermal_sys.c:63: warning: 'thermal_event_seqnum' defined but not used
,which happens when CONFIG_NET is not set.
Move 'thermal_event_seqnum' definition inside the '#ifdef CONFIG_NET'
---
Change since v1:
- Sent corrupted patch in v1, and fixed now
drivers/thermal/thermal_sys.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/thermal/thermal_sys.c +2 -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;
@@ -1304,6 +1302,8 @@ static struct genl_multicast_group thermal_event_mcgrp = { .name = THERMAL_GENL_MCAST_GROUP_NAME, }; +static unsigned int thermal_event_seqnum; +int generate_netlink_event (u32 orig,enum events event) {struct sk_buff *skb;
Signature · 1 line
1.7.1
Quoted 9 lines · Fabio Estevam
Fix the following build warning:
drivers/thermal/thermal_sys.c:63: warning: 'thermal_event_seqnum' defined but not used,which happens when
CONFIG_NETis not set.Move '
thermal_event_seqnum' definition inside the '#ifdefCONFIG_NET'Signed-off-by Fabio Estevam <[email protected]>
Quoted 31 lines
---
Change since v1:
- Sent corrupted patch in v1, and fixed nowdrivers/thermal/thermal_sys.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)drivers/thermal/thermal_sys.c +2
-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;@@ -1304,6 +1302,8 @@ static struct genl_multicast_group thermal_event_mcgrp = { .name = THERMAL_GENL_MCAST_GROUP_NAME, }; +static unsigned int thermal_event_seqnum; +int generate_netlink_event (u32 orig,enum events event) {struct sk_buff *skb;Signature · 1 line
1.7.1
Quoted 9 lines
From: Fabio Estevam [mailto:[email protected]]
Sent: Sunday, January 22, 2012 10:16 PM
To: [email protected]
Cc: [email protected]; [email protected]; R, Durgadoss; [email protected]; Fabio Estevam
Subject: [PATCH v2] thermal:thermal_sys: Fix build warningFix the following build warning:
Quoted 8 lines
drivers/thermal/thermal_sys.c:63: warning: 'thermal_event_seqnum' defined but not used,which happens when
CONFIG_NETis not set.Move '
thermal_event_seqnum' definition inside the '#ifdefCONFIG_NET'Signed-off-by Fabio Estevam <[email protected]>
[snip.]
Thanks,
Durga
Quoted 29 lines · On Sun, 22 Jan 2012 14:46:01 -0200 Fabio Estevam <[email protected]> wrote:
Fix the following build warning:
drivers/thermal/thermal_sys.c:63: warning: 'thermal_event_seqnum' defined but not used,which happens when
CONFIG_NETis not set.Move '
thermal_event_seqnum' definition inside the '#ifdefCONFIG_NET'Signed-off-by Fabio Estevam <[email protected]>---
Change since v1:
- Sent corrupted patch in v1, and fixed nowdrivers/thermal/thermal_sys.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)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;
drivers/thermal/thermal_sys.c static struct genl_multicast_group thermal_event_mcgrp = { · line 1309
Quoted 8 lines
drivers/thermal/thermal_sys.c +2
-0@@ -1304,6 +1302,8 @@ static struct genl_multicast_group thermal_event_mcgrp = { .name = THERMAL_GENL_MCAST_GROUP_NAME, }; +static unsigned int thermal_event_seqnum; +int generate_netlink_event (u32 orig,enum events event) {struct sk_buff *skb;
It is better to make this variable local to the (only) function which uses it:
drivers/thermal/thermal_sys.c renamed from drivers/thermal/thermal_sys.c~thermal-thermal_sys-fix-build-warning-fix +1 -2
@@ -1302,8 +1302,6 @@ static struct genl_multicast_group therm .name = THERMAL_GENL_MCAST_GROUP_NAME, }; -static unsigned int thermal_event_seqnum; -int thermal_generate_netlink_event (u32 orig,enum events event) {struct sk_buff *skb;
@@ -1312,6 +1310,7 @@ int thermal_generate_netlink_event(u32 ovoid *msg_header;int size;int result; +static unsigned int thermal_event_seqnum;/* allocate memory */ size = nla_total_size(sizeof(struct thermal_genl_event)) + \
_