* [PATCH] thermal: thermal_sys: Fix build warning
@ 2012-01-22 16:33 Fabio Estevam
2012-01-22 16:46 ` [PATCH v2] " Fabio Estevam
0 siblings, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2012-01-22 16:33 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, guenter.roeck, durgadoss.r, khali, 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_NET is not set.
Move 'thermal_event_seqnum' definition inside the '#ifdef CONFIG_NET'
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
drivers/thermal/thermal_sys.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index dd9a574..11f5955 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -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;
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2] thermal: thermal_sys: Fix build warning
2012-01-22 16:33 [PATCH] thermal: thermal_sys: Fix build warning Fabio Estevam
@ 2012-01-22 16:46 ` Fabio Estevam
2012-01-22 18:11 ` Guenter Roeck
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Fabio Estevam @ 2012-01-22 16:46 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, guenter.roeck, durgadoss.r, khali, 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_NET is not set.
Move 'thermal_event_seqnum' definition inside the '#ifdef CONFIG_NET'
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Change since v1:
- Sent corrupted patch in v1, and fixed now
drivers/thermal/thermal_sys.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index dd9a574..11f5955 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -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;
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] thermal: thermal_sys: Fix build warning
2012-01-22 16:46 ` [PATCH v2] " Fabio Estevam
@ 2012-01-22 18:11 ` Guenter Roeck
2012-01-23 2:57 ` R, Durgadoss
2012-01-24 22:41 ` Andrew Morton
2 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2012-01-22 18:11 UTC (permalink / raw)
To: Fabio Estevam; +Cc: linux-kernel, akpm, durgadoss.r, khali, Rafael J. Wysocki
On Sun, Jan 22, 2012 at 11:46:01AM -0500, Fabio Estevam wrote:
> 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'
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
> ---
> Change since v1:
> - Sent corrupted patch in v1, and fixed now
> drivers/thermal/thermal_sys.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
> index dd9a574..11f5955 100644
> --- a/drivers/thermal/thermal_sys.c
> +++ b/drivers/thermal/thermal_sys.c
> @@ -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;
> --
> 1.7.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH v2] thermal: thermal_sys: Fix build warning
2012-01-22 16:46 ` [PATCH v2] " Fabio Estevam
2012-01-22 18:11 ` Guenter Roeck
@ 2012-01-23 2:57 ` R, Durgadoss
2012-01-24 22:41 ` Andrew Morton
2 siblings, 0 replies; 5+ messages in thread
From: R, Durgadoss @ 2012-01-23 2:57 UTC (permalink / raw)
To: Fabio Estevam, linux-kernel; +Cc: akpm, guenter.roeck, khali, Fabio Estevam
> From: Fabio Estevam [mailto:festevam@gmail.com]
> Sent: Sunday, January 22, 2012 10:16 PM
> To: linux-kernel@vger.kernel.org
> Cc: akpm@linux-foundation.org; guenter.roeck@ericsson.com; R, Durgadoss;
> khali@linux-fr.org; Fabio Estevam
> Subject: [PATCH v2] 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'
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Durgadoss R <durgadoss.r@intel.com>
[snip.]
Thanks,
Durga
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] thermal: thermal_sys: Fix build warning
2012-01-22 16:46 ` [PATCH v2] " Fabio Estevam
2012-01-22 18:11 ` Guenter Roeck
2012-01-23 2:57 ` R, Durgadoss
@ 2012-01-24 22:41 ` Andrew Morton
2 siblings, 0 replies; 5+ messages in thread
From: Andrew Morton @ 2012-01-24 22:41 UTC (permalink / raw)
To: Fabio Estevam
Cc: linux-kernel, guenter.roeck, durgadoss.r, khali, Fabio Estevam
On Sun, 22 Jan 2012 14:46:01 -0200
Fabio Estevam <festevam@gmail.com> wrote:
> 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'
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> Change since v1:
> - Sent corrupted patch in v1, and fixed now
> drivers/thermal/thermal_sys.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
> index dd9a574..11f5955 100644
> --- a/drivers/thermal/thermal_sys.c
> +++ b/drivers/thermal/thermal_sys.c
> @@ -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;
It is better to make this variable local to the (only) function which
uses it:
--- a/drivers/thermal/thermal_sys.c~thermal-thermal_sys-fix-build-warning-fix
+++ a/drivers/thermal/thermal_sys.c
@@ -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 o
void *msg_header;
int size;
int result;
+ static unsigned int thermal_event_seqnum;
/* allocate memory */
size = nla_total_size(sizeof(struct thermal_genl_event)) + \
_
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-01-24 22:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-22 16:33 [PATCH] thermal: thermal_sys: Fix build warning Fabio Estevam
2012-01-22 16:46 ` [PATCH v2] " Fabio Estevam
2012-01-22 18:11 ` Guenter Roeck
2012-01-23 2:57 ` R, Durgadoss
2012-01-24 22:41 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).