public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] FIXED sparse warning : drivers/cpuidle/cpuidle.c:27:1: warning: symbol 'cpuidle_dev' was not
@ 2013-10-02 18:59 Sagar Padhye
  2013-10-02 19:24 ` [PATCH] FIXED sparse warning : drivers/cpuidle/cpuidle.c:27:1: warning: symbol 'cpuidle_dev' was Dan Carpenter
  2013-10-04  8:37 ` Dan Carpenter
  0 siblings, 2 replies; 4+ messages in thread
From: Sagar Padhye @ 2013-10-02 18:59 UTC (permalink / raw)
  To: kernel-janitors

---
This is the first patch I am sending out, hope this is ok. I checked that cpuidle_devices is only being used in cpuidle.c - hence thought that it can be made static and be removed from header.

 drivers/cpuidle/cpuidle.c | 4 ++--
 include/linux/cpuidle.h   | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index d75040d..4826506 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -23,8 +23,8 @@
 
 #include "cpuidle.h"
 
-DEFINE_PER_CPU(struct cpuidle_device *, cpuidle_devices);
-DEFINE_PER_CPU(struct cpuidle_device, cpuidle_dev);
+static DEFINE_PER_CPU(struct cpuidle_device *, cpuidle_devices);
+static DEFINE_PER_CPU(struct cpuidle_device, cpuidle_dev);
 
 DEFINE_MUTEX(cpuidle_lock);
 LIST_HEAD(cpuidle_detected_devices);
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 781addc..96c8ed8 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -83,7 +83,6 @@ struct cpuidle_device {
 #endif
 };
 
-DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices);
 
 /**
  * cpuidle_get_last_residency - retrieves the last state's residency time
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] FIXED sparse warning : drivers/cpuidle/cpuidle.c:27:1: warning: symbol 'cpuidle_dev' was
  2013-10-02 18:59 [PATCH] FIXED sparse warning : drivers/cpuidle/cpuidle.c:27:1: warning: symbol 'cpuidle_dev' was not Sagar Padhye
@ 2013-10-02 19:24 ` Dan Carpenter
  2013-10-03  6:46   ` Sagar Padhye
  2013-10-04  8:37 ` Dan Carpenter
  1 sibling, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2013-10-02 19:24 UTC (permalink / raw)
  To: kernel-janitors

On Thu, Oct 03, 2013 at 12:17:04AM +0530, Sagar Padhye wrote:
> ---
> This is the first patch I am sending out, hope this is ok.

Hi hi,

Kernel Janitors is a newbie friendly list so that's fine.

> I checked that cpuidle_devices is only being used in cpuidle.c - hence
> thought that it can be made static and be removed from header.

"cpuidle_devices" is actually used in drivers/cpuidle/coupled.c as well
so this breaks the build.

Even for "cpuidle_dev" the patch isn't right.  It doesn't fix the
warning, for me.  The DEFINE_PER_CPU() macro defines several variables
actually.  Per CPU variables are a bit complicated and they have to have
globally unique names.  So just ignore the Sparse warning for per CPU
variables.

There are several other "process" problems with the patch submission.

1) Incorrect subject.  It should be:
	[PATCH] cpuidle: make a variable static

   This is based on `git log --oneline drivers/cpuidle/cpuidle.c`
   output.

2) No blank line between subject and body of commit message.
3) Line wrap the body of the email at 72 characters.
4) No Signed-off-by line.

Anyway, don't feel bad that your first patch had problems, we all
started as beginners.

regards,
dan carpenter



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] FIXED sparse warning : drivers/cpuidle/cpuidle.c:27:1: warning: symbol 'cpuidle_dev' was
  2013-10-02 19:24 ` [PATCH] FIXED sparse warning : drivers/cpuidle/cpuidle.c:27:1: warning: symbol 'cpuidle_dev' was Dan Carpenter
@ 2013-10-03  6:46   ` Sagar Padhye
  0 siblings, 0 replies; 4+ messages in thread
From: Sagar Padhye @ 2013-10-03  6:46 UTC (permalink / raw)
  To: kernelnewbies

> > I checked that cpuidle_devices is only being used in cpuidle.c - hence
> > thought that it can be made static and be removed from header.
> 
> "cpuidle_devices" is actually used in drivers/cpuidle/coupled.c as well
> so this breaks the build.

Darn! I forgot 'clean build' part. sorry.
 
> Even for "cpuidle_dev" the patch isn't right.  It doesn't fix the
> warning, for me.  The DEFINE_PER_CPU() macro defines several variables
> actually.  Per CPU variables are a bit complicated and they have to have
> globally unique names.  So just ignore the Sparse warning for per CPU
> variables.
> 

Ok, let me look at my sparse log once again, will pick some other problem (any suggestions?)

> There are several other "process" problems with the patch submission.
> 
> 1) Incorrect subject.  It should be:
> 	[PATCH] cpuidle: make a variable static
> 
>    This is based on `git log --oneline drivers/cpuidle/cpuidle.c`
>    output.
> 
> 2) No blank line between subject and body of commit message.
> 3) Line wrap the body of the email at 72 characters.
> 4) No Signed-off-by line.
> 

Ok, will keep this in mind

Thanks and Regards,
Sagar 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] FIXED sparse warning : drivers/cpuidle/cpuidle.c:27:1: warning: symbol 'cpuidle_dev' was
  2013-10-02 18:59 [PATCH] FIXED sparse warning : drivers/cpuidle/cpuidle.c:27:1: warning: symbol 'cpuidle_dev' was not Sagar Padhye
  2013-10-02 19:24 ` [PATCH] FIXED sparse warning : drivers/cpuidle/cpuidle.c:27:1: warning: symbol 'cpuidle_dev' was Dan Carpenter
@ 2013-10-04  8:37 ` Dan Carpenter
  1 sibling, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2013-10-04  8:37 UTC (permalink / raw)
  To: kernel-janitors

On Thu, Oct 03, 2013 at 12:04:40PM +0530, Sagar Padhye wrote:
> > > I checked that cpuidle_devices is only being used in cpuidle.c - hence
> > > thought that it can be made static and be removed from header.
> > 
> > "cpuidle_devices" is actually used in drivers/cpuidle/coupled.c as well
> > so this breaks the build.
> 
> Darn! I forgot 'clean build' part. sorry.
>  
> > Even for "cpuidle_dev" the patch isn't right.  It doesn't fix the
> > warning, for me.  The DEFINE_PER_CPU() macro defines several variables
> > actually.  Per CPU variables are a bit complicated and they have to have
> > globally unique names.  So just ignore the Sparse warning for per CPU
> > variables.
> > 
> 
> Ok, let me look at my sparse log once again, will pick some other
> problem (any suggestions?)

You're on the right track.  Just the details are wrong.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-10-04  8:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-02 18:59 [PATCH] FIXED sparse warning : drivers/cpuidle/cpuidle.c:27:1: warning: symbol 'cpuidle_dev' was not Sagar Padhye
2013-10-02 19:24 ` [PATCH] FIXED sparse warning : drivers/cpuidle/cpuidle.c:27:1: warning: symbol 'cpuidle_dev' was Dan Carpenter
2013-10-03  6:46   ` Sagar Padhye
2013-10-04  8:37 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox