Message ID | 1411140580-20909-8-git-send-email-jeffrey.t.kirsher@intel.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
On Fri, Sep 19, 2014 at 5:29 PM, Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote: > From: Mark Rustad <mark.d.rustad@intel.com> > > Use diagnostic control macros to ignore nested-externs warnings > in this case. > > CC: Ingo Molnar <mingo@redhat.com> > CC: Peter Zijlstra <peterz@infradead.org> > CC: Brian Norris <computersforpeace@gmail.com> > Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> > --- > include/linux/sched.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/linux/sched.h b/include/linux/sched.h > index 5c2c885..ed52c76 100644 > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -832,7 +832,9 @@ static inline int sched_info_on(void) > #ifdef CONFIG_SCHEDSTATS > return 1; > #elif defined(CONFIG_TASK_DELAY_ACCT) > + DIAG_PUSH DIAG_IGNORE(nested-externs) > extern int delayacct_on; > + DIAG_POP This ridiculous, please try to move this extern into the appropriate header file instead of surrounding it with these macros.
On Sep 19, 2014, at 12:34 PM, Richard Weinberger <richard.weinberger@gmail.com> wrote: > On Fri, Sep 19, 2014 at 5:29 PM, Jeff Kirsher > <jeffrey.t.kirsher@intel.com> wrote: >> From: Mark Rustad <mark.d.rustad@intel.com> >> >> Use diagnostic control macros to ignore nested-externs warnings >> in this case. >> >> CC: Ingo Molnar <mingo@redhat.com> >> CC: Peter Zijlstra <peterz@infradead.org> >> CC: Brian Norris <computersforpeace@gmail.com> >> Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> >> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> >> --- >> include/linux/sched.h | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/include/linux/sched.h b/include/linux/sched.h >> index 5c2c885..ed52c76 100644 >> --- a/include/linux/sched.h >> +++ b/include/linux/sched.h >> @@ -832,7 +832,9 @@ static inline int sched_info_on(void) >> #ifdef CONFIG_SCHEDSTATS >> return 1; >> #elif defined(CONFIG_TASK_DELAY_ACCT) >> + DIAG_PUSH DIAG_IGNORE(nested-externs) >> extern int delayacct_on; >> + DIAG_POP > > This ridiculous, please try to move this extern into the appropriate header file > instead of surrounding it with these macros. Excellent. I'll try adding an include of delayacct.h instead. My patch was based on the assumption that the existing code was wanted in that form for some reason, so the patch served a purpose in recognizing that it isn't. So the macros have served a purpose before even being in place. :-)
Am 19.09.2014 22:34, schrieb Rustad, Mark D:
> Excellent. I'll try adding an include of delayacct.h instead. My patch was based on the assumption that the existing code was wanted in that form for some reason, so the patch served a purpose in recognizing that it isn't. So the macros have served a purpose before even being in place. :-)
I bet sched.h does not include delayacct.h for a good reason.
sched.h is included in a lot of files, maybe delayacct.h introduces nasty dependency issues.
You'll find out. ;-)
Thanks,
//richard
On Sep 19, 2014, at 1:41 PM, Richard Weinberger <richard@nod.at> wrote: > Am 19.09.2014 22:34, schrieb Rustad, Mark D: >> Excellent. I'll try adding an include of delayacct.h instead. My patch was based on the assumption that the existing code was wanted in that form for some reason, so the patch served a purpose in recognizing that it isn't. So the macros have served a purpose before even being in place. :-) > > I bet sched.h does not include delayacct.h for a good reason. > sched.h is included in a lot of files, maybe delayacct.h introduces nasty dependency issues. > You'll find out. ;-) Right you are, but when I'm done, there will only be one extern declaration for that global, which is better than more than one. I'll think a little before settling on the best resolution.
On Fri, Sep 19, 2014 at 08:29:40AM -0700, Jeff Kirsher wrote: > From: Mark Rustad <mark.d.rustad@intel.com> > > Use diagnostic control macros to ignore nested-externs warnings > in this case. > > CC: Ingo Molnar <mingo@redhat.com> > CC: Peter Zijlstra <peterz@infradead.org> > CC: Brian Norris <computersforpeace@gmail.com> > Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> > --- > include/linux/sched.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/linux/sched.h b/include/linux/sched.h > index 5c2c885..ed52c76 100644 > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -832,7 +832,9 @@ static inline int sched_info_on(void) > #ifdef CONFIG_SCHEDSTATS > return 1; > #elif defined(CONFIG_TASK_DELAY_ACCT) > + DIAG_PUSH DIAG_IGNORE(nested-externs) > extern int delayacct_on; > + DIAG_POP > return delayacct_on; Who has this nested extern warn on in anycase? I've never seen it generate a warning. Also WTF is DIAG_PUSH/POP, its not a GCC thing afaict. -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Sep 19, 2014, at 3:54 PM, Peter Zijlstra <peterz@infradead.org> wrote: > On Fri, Sep 19, 2014 at 08:29:40AM -0700, Jeff Kirsher wrote: >> From: Mark Rustad <mark.d.rustad@intel.com> >> >> Use diagnostic control macros to ignore nested-externs warnings >> in this case. >> >> CC: Ingo Molnar <mingo@redhat.com> >> CC: Peter Zijlstra <peterz@infradead.org> >> CC: Brian Norris <computersforpeace@gmail.com> >> Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> >> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> >> --- >> include/linux/sched.h | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/include/linux/sched.h b/include/linux/sched.h >> index 5c2c885..ed52c76 100644 >> --- a/include/linux/sched.h >> +++ b/include/linux/sched.h >> @@ -832,7 +832,9 @@ static inline int sched_info_on(void) >> #ifdef CONFIG_SCHEDSTATS >> return 1; >> #elif defined(CONFIG_TASK_DELAY_ACCT) >> + DIAG_PUSH DIAG_IGNORE(nested-externs) >> extern int delayacct_on; >> + DIAG_POP >> return delayacct_on; > > Who has this nested extern warn on in anycase? They appear in W=2 builds, so you do have to ask for them. > I've never seen it > generate a warning. Also WTF is DIAG_PUSH/POP, its not a GCC thing > afaict. The first patch in the series adds macros to use the gcc/clang pragmas to control these things. Both compilers have the capability. The macros generate nothing for compilers that lack it. In any case, this particular one will be resolved instead of silenced.
diff --git a/include/linux/sched.h b/include/linux/sched.h index 5c2c885..ed52c76 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -832,7 +832,9 @@ static inline int sched_info_on(void) #ifdef CONFIG_SCHEDSTATS return 1; #elif defined(CONFIG_TASK_DELAY_ACCT) + DIAG_PUSH DIAG_IGNORE(nested-externs) extern int delayacct_on; + DIAG_POP return delayacct_on; #else return 0;