* [PATCH/trivial] might_sleep: Make file parameter const char *
@ 2009-12-23 10:08 Simon Kagstrom
2009-12-28 10:10 ` [tip:sched/urgent] sched: might_sleep(): " tip-bot for Simon Kagstrom
0 siblings, 1 reply; 6+ messages in thread
From: Simon Kagstrom @ 2009-12-23 10:08 UTC (permalink / raw)
To: lkml; +Cc: Ingo Molnar, peterz
Fixes a warning when building with g++:
warning: deprecated conversion from string constant to 'char*'
And the file parameter use is constant, so mark it as such.
Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
---
include/linux/kernel.h | 5 +++--
kernel/sched.c | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 3fc9f5a..785d7d1 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -124,7 +124,7 @@ extern int _cond_resched(void);
#endif
#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
- void __might_sleep(char *file, int line, int preempt_offset);
+ void __might_sleep(const char *file, int line, int preempt_offset);
/**
* might_sleep - annotation for functions that can sleep
*
@@ -138,7 +138,8 @@ extern int _cond_resched(void);
# define might_sleep() \
do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0)
#else
- static inline void __might_sleep(char *file, int line, int preempt_offset) { }
+ static inline void __might_sleep(const char *file, int line,
+ int preempt_offset) { }
# define might_sleep() do { might_resched(); } while (0)
#endif
diff --git a/kernel/sched.c b/kernel/sched.c
index 87f1f47..506e0ac 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -9695,7 +9695,7 @@ static inline int preempt_count_equals(int preempt_offset)
return (nested == PREEMPT_INATOMIC_BASE + preempt_offset);
}
-void __might_sleep(char *file, int line, int preempt_offset)
+void __might_sleep(const char *file, int line, int preempt_offset)
{
#ifdef in_atomic
static unsigned long prev_jiffy; /* ratelimiting */
--
1.6.0.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* [tip:sched/urgent] sched: might_sleep(): Make file parameter const char *
2009-12-23 10:08 [PATCH/trivial] might_sleep: Make file parameter const char * Simon Kagstrom
@ 2009-12-28 10:10 ` tip-bot for Simon Kagstrom
2009-12-29 12:11 ` Peter Zijlstra
0 siblings, 1 reply; 6+ messages in thread
From: tip-bot for Simon Kagstrom @ 2009-12-28 10:10 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, simon.kagstrom, tglx, mingo
Commit-ID: d894837f23f491aa7ed167aae767fc07cfe6e6e6
Gitweb: http://git.kernel.org/tip/d894837f23f491aa7ed167aae767fc07cfe6e6e6
Author: Simon Kagstrom <simon.kagstrom@netinsight.net>
AuthorDate: Wed, 23 Dec 2009 11:08:18 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 28 Dec 2009 10:50:13 +0100
sched: might_sleep(): Make file parameter const char *
Fixes a warning when building with g++:
warning: deprecated conversion from string constant to 'char*'
And the file parameter use is constant, so mark it as such.
Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
Cc: peterz@infradead.org
LKML-Reference: <20091223110818.442d848e@marrow.netinsight.se>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
include/linux/kernel.h | 5 +++--
kernel/sched.c | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 3fc9f5a..785d7d1 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -124,7 +124,7 @@ extern int _cond_resched(void);
#endif
#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
- void __might_sleep(char *file, int line, int preempt_offset);
+ void __might_sleep(const char *file, int line, int preempt_offset);
/**
* might_sleep - annotation for functions that can sleep
*
@@ -138,7 +138,8 @@ extern int _cond_resched(void);
# define might_sleep() \
do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0)
#else
- static inline void __might_sleep(char *file, int line, int preempt_offset) { }
+ static inline void __might_sleep(const char *file, int line,
+ int preempt_offset) { }
# define might_sleep() do { might_resched(); } while (0)
#endif
diff --git a/kernel/sched.c b/kernel/sched.c
index c535cc4..64298a5 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -9694,7 +9694,7 @@ static inline int preempt_count_equals(int preempt_offset)
return (nested == PREEMPT_INATOMIC_BASE + preempt_offset);
}
-void __might_sleep(char *file, int line, int preempt_offset)
+void __might_sleep(const char *file, int line, int preempt_offset)
{
#ifdef in_atomic
static unsigned long prev_jiffy; /* ratelimiting */
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [tip:sched/urgent] sched: might_sleep(): Make file parameter const char *
2009-12-28 10:10 ` [tip:sched/urgent] sched: might_sleep(): " tip-bot for Simon Kagstrom
@ 2009-12-29 12:11 ` Peter Zijlstra
2009-12-30 9:25 ` Ingo Molnar
2010-01-04 9:49 ` Simon Kagstrom
0 siblings, 2 replies; 6+ messages in thread
From: Peter Zijlstra @ 2009-12-29 12:11 UTC (permalink / raw)
To: mingo, hpa, linux-kernel, tglx, simon.kagstrom, mingo; +Cc: linux-tip-commits
On Mon, 2009-12-28 at 10:10 +0000, tip-bot for Simon Kagstrom wrote:
> Fixes a warning when building with g++:
However did you manage to build stuff with g++? The kernel very
frequently uses C++ keywords for other things.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [tip:sched/urgent] sched: might_sleep(): Make file parameter const char *
2009-12-29 12:11 ` Peter Zijlstra
@ 2009-12-30 9:25 ` Ingo Molnar
2010-01-04 9:49 ` Simon Kagstrom
1 sibling, 0 replies; 6+ messages in thread
From: Ingo Molnar @ 2009-12-30 9:25 UTC (permalink / raw)
To: Peter Zijlstra
Cc: mingo, hpa, linux-kernel, tglx, simon.kagstrom, linux-tip-commits
* Peter Zijlstra <peterz@infradead.org> wrote:
> On Mon, 2009-12-28 at 10:10 +0000, tip-bot for Simon Kagstrom wrote:
>
> > Fixes a warning when building with g++:
>
> However did you manage to build stuff with g++? The kernel very
> frequently uses C++ keywords for other things.
yeah, good question. Alas the change itself (const propagation) looked good so
i applied it.
Ingo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [tip:sched/urgent] sched: might_sleep(): Make file parameter const char *
2009-12-29 12:11 ` Peter Zijlstra
2009-12-30 9:25 ` Ingo Molnar
@ 2010-01-04 9:49 ` Simon Kagstrom
2010-01-04 10:36 ` Peter Zijlstra
1 sibling, 1 reply; 6+ messages in thread
From: Simon Kagstrom @ 2010-01-04 9:49 UTC (permalink / raw)
To: Peter Zijlstra; +Cc: mingo, hpa, linux-kernel, tglx, mingo, linux-tip-commits
(Back from vacation, hence the delayed response)
On Tue, 29 Dec 2009 13:11:48 +0100
Peter Zijlstra <peterz@infradead.org> wrote:
> On Mon, 2009-12-28 at 10:10 +0000, tip-bot for Simon Kagstrom wrote:
>
> > Fixes a warning when building with g++:
>
> However did you manage to build stuff with g++? The kernel very
> frequently uses C++ keywords for other things.
I expected this question :-)
Yes, there are some workarounds we have to make to get it compiling
(like #define new NEW prior to including the headers), but it works
out. I know this is something you shouldn't do, and I debated whether
to mention C++ at all.
Anyway, I think the change itself makes sense for plain C as well. The
comment just described the context where it showed up for us.
// Simon
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [tip:sched/urgent] sched: might_sleep(): Make file parameter const char *
2010-01-04 9:49 ` Simon Kagstrom
@ 2010-01-04 10:36 ` Peter Zijlstra
0 siblings, 0 replies; 6+ messages in thread
From: Peter Zijlstra @ 2010-01-04 10:36 UTC (permalink / raw)
To: Simon Kagstrom; +Cc: mingo, hpa, linux-kernel, tglx, mingo, linux-tip-commits
On Mon, 2010-01-04 at 10:49 +0100, Simon Kagstrom wrote:
> (Back from vacation, hence the delayed response)
>
> On Tue, 29 Dec 2009 13:11:48 +0100
> Peter Zijlstra <peterz@infradead.org> wrote:
>
> > On Mon, 2009-12-28 at 10:10 +0000, tip-bot for Simon Kagstrom wrote:
> >
> > > Fixes a warning when building with g++:
> >
> > However did you manage to build stuff with g++? The kernel very
> > frequently uses C++ keywords for other things.
>
> I expected this question :-)
>
> Yes, there are some workarounds we have to make to get it compiling
> (like #define new NEW prior to including the headers), but it works
> out. I know this is something you shouldn't do, and I debated whether
> to mention C++ at all.
>
>
> Anyway, I think the change itself makes sense for plain C as well. The
> comment just described the context where it showed up for us.
Oh sure, the change is fine, just wondering what specific drug you were
using as it was not the regular kernel kind ;-)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-01-04 10:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-23 10:08 [PATCH/trivial] might_sleep: Make file parameter const char * Simon Kagstrom
2009-12-28 10:10 ` [tip:sched/urgent] sched: might_sleep(): " tip-bot for Simon Kagstrom
2009-12-29 12:11 ` Peter Zijlstra
2009-12-30 9:25 ` Ingo Molnar
2010-01-04 9:49 ` Simon Kagstrom
2010-01-04 10:36 ` Peter Zijlstra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox