* [PATCH] x86: smpboot: mark array as const
@ 2011-06-30 22:31 Greg Dietsche
2011-07-01 0:21 ` [tip:x86/cleanups] x86, smpboot: Mark names[] " tip-bot for Greg Dietsche
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Greg Dietsche @ 2011-06-30 22:31 UTC (permalink / raw)
To: kernel-janitors
This array is read-only. Make it explicit by marking as const.
Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
---
arch/x86/kernel/smpboot.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 9fd3137..4218569 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -438,7 +438,7 @@ static void impress_friends(void)
void __inquire_remote_apic(int apicid)
{
unsigned i, regs[] = { APIC_ID >> 4, APIC_LVR >> 4, APIC_SPIV >> 4 };
- char *names[] = { "ID", "VERSION", "SPIV" };
+ const char const *names[] = { "ID", "VERSION", "SPIV" };
int timeout;
u32 status;
--
1.7.2.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [tip:x86/cleanups] x86, smpboot: Mark names[] array as const
2011-06-30 22:31 [PATCH] x86: smpboot: mark array as const Greg Dietsche
@ 2011-07-01 0:21 ` tip-bot for Greg Dietsche
2011-07-01 0:25 ` H. Peter Anvin
2011-07-01 0:23 ` [PATCH] x86: smpboot: mark " H. Peter Anvin
2011-07-01 1:13 ` Greg Dietsche
2 siblings, 1 reply; 9+ messages in thread
From: tip-bot for Greg Dietsche @ 2011-07-01 0:21 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, Gregory.Dietsche, tglx, hpa
Commit-ID: a5fd117a8fda8621e1ae1bb3b8d55e4c0ebabd94
Gitweb: http://git.kernel.org/tip/a5fd117a8fda8621e1ae1bb3b8d55e4c0ebabd94
Author: Greg Dietsche <Gregory.Dietsche@cuw.edu>
AuthorDate: Thu, 30 Jun 2011 17:31:48 -0500
Committer: H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Thu, 30 Jun 2011 16:44:12 -0700
x86, smpboot: Mark names[] array as const
The array names[] in __inquire_remote_apic is read-only. Make it
explicit by marking as const.
Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Link: http://lkml.kernel.org/r/1309473108-5337-1-git-send-email-Gregory.Dietsche@cuw.edu
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
arch/x86/kernel/smpboot.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index a3c430b..4dbf60e 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -425,7 +425,7 @@ static void impress_friends(void)
void __inquire_remote_apic(int apicid)
{
unsigned i, regs[] = { APIC_ID >> 4, APIC_LVR >> 4, APIC_SPIV >> 4 };
- char *names[] = { "ID", "VERSION", "SPIV" };
+ const char const *names[] = { "ID", "VERSION", "SPIV" };
int timeout;
u32 status;
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] x86: smpboot: mark array as const
2011-06-30 22:31 [PATCH] x86: smpboot: mark array as const Greg Dietsche
2011-07-01 0:21 ` [tip:x86/cleanups] x86, smpboot: Mark names[] " tip-bot for Greg Dietsche
@ 2011-07-01 0:23 ` H. Peter Anvin
2011-07-01 1:13 ` Greg Dietsche
2 siblings, 0 replies; 9+ messages in thread
From: H. Peter Anvin @ 2011-07-01 0:23 UTC (permalink / raw)
To: kernel-janitors
On 06/30/2011 03:31 PM, Greg Dietsche wrote:
> This array is read-only. Make it explicit by marking as const.
>
> Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
> ---
> arch/x86/kernel/smpboot.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
> index 9fd3137..4218569 100644
> --- a/arch/x86/kernel/smpboot.c
> +++ b/arch/x86/kernel/smpboot.c
> @@ -438,7 +438,7 @@ static void impress_friends(void)
> void __inquire_remote_apic(int apicid)
> {
> unsigned i, regs[] = { APIC_ID >> 4, APIC_LVR >> 4, APIC_SPIV >> 4 };
> - char *names[] = { "ID", "VERSION", "SPIV" };
> + const char const *names[] = { "ID", "VERSION", "SPIV" };
> int timeout;
Did you mean "const char * const" here?
-hpa
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [tip:x86/cleanups] x86, smpboot: Mark names[] array as const
2011-07-01 0:21 ` [tip:x86/cleanups] x86, smpboot: Mark names[] " tip-bot for Greg Dietsche
@ 2011-07-01 0:25 ` H. Peter Anvin
2011-07-01 0:41 ` Greg Dietsche
0 siblings, 1 reply; 9+ messages in thread
From: H. Peter Anvin @ 2011-07-01 0:25 UTC (permalink / raw)
To: mingo, hpa, linux-kernel, Gregory.Dietsche, tglx, hpa; +Cc: linux-tip-commits
On 06/30/2011 05:21 PM, tip-bot for Greg Dietsche wrote:
> + const char const *names[] = { "ID", "VERSION", "SPIV" };
^^^^^^^^^^^^^^^^
Doesn't make sense, patch removed...
-hpa
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [tip:x86/cleanups] x86, smpboot: Mark names[] array as const
2011-07-01 0:25 ` H. Peter Anvin
@ 2011-07-01 0:41 ` Greg Dietsche
2011-07-01 0:47 ` H. Peter Anvin
0 siblings, 1 reply; 9+ messages in thread
From: Greg Dietsche @ 2011-07-01 0:41 UTC (permalink / raw)
To: H. Peter Anvin
Cc: mingo, linux-kernel, Gregory.Dietsche, tglx, hpa, linux-tip-commits
On Thu, Jun 30, 2011 at 05:25:36PM -0700, H. Peter Anvin wrote:
> On 06/30/2011 05:21 PM, tip-bot for Greg Dietsche wrote:
> > + const char const *names[] = { "ID", "VERSION", "SPIV" };
> ^^^^^^^^^^^^^^^^
>
> Doesn't make sense, patch removed...
>
could you explain a little more? I don't see my mistake.
it compiles and is running on my box currently.
Thanks!
Greg
> -hpa
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [tip:x86/cleanups] x86, smpboot: Mark names[] array as const
2011-07-01 0:41 ` Greg Dietsche
@ 2011-07-01 0:47 ` H. Peter Anvin
2011-07-01 1:20 ` Brian Gerst
0 siblings, 1 reply; 9+ messages in thread
From: H. Peter Anvin @ 2011-07-01 0:47 UTC (permalink / raw)
To: Greg Dietsche
Cc: H. Peter Anvin, mingo, linux-kernel, Gregory.Dietsche, tglx,
linux-tip-commits
On 06/30/2011 05:41 PM, Greg Dietsche wrote:
> On Thu, Jun 30, 2011 at 05:25:36PM -0700, H. Peter Anvin wrote:
>> On 06/30/2011 05:21 PM, tip-bot for Greg Dietsche wrote:
>>> + const char const *names[] = { "ID", "VERSION", "SPIV" };
>> ^^^^^^^^^^^^^^^^
>>
>> Doesn't make sense, patch removed...
>>
> could you explain a little more? I don't see my mistake.
> it compiles and is running on my box currently.
>
Those two "const"s are redundant.
-hpa
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] x86: smpboot: mark array as const
2011-06-30 22:31 [PATCH] x86: smpboot: mark array as const Greg Dietsche
2011-07-01 0:21 ` [tip:x86/cleanups] x86, smpboot: Mark names[] " tip-bot for Greg Dietsche
2011-07-01 0:23 ` [PATCH] x86: smpboot: mark " H. Peter Anvin
@ 2011-07-01 1:13 ` Greg Dietsche
2 siblings, 0 replies; 9+ messages in thread
From: Greg Dietsche @ 2011-07-01 1:13 UTC (permalink / raw)
To: kernel-janitors
On Thu, Jun 30, 2011 at 05:23:03PM -0700, H. Peter Anvin wrote:
> On 06/30/2011 03:31 PM, Greg Dietsche wrote:
> > This array is read-only. Make it explicit by marking as const.
> >
> > Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
> > ---
> > arch/x86/kernel/smpboot.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
> > index 9fd3137..4218569 100644
> > --- a/arch/x86/kernel/smpboot.c
> > +++ b/arch/x86/kernel/smpboot.c
> > @@ -438,7 +438,7 @@ static void impress_friends(void)
> > void __inquire_remote_apic(int apicid)
> > {
> > unsigned i, regs[] = { APIC_ID >> 4, APIC_LVR >> 4, APIC_SPIV >> 4 };
> > - char *names[] = { "ID", "VERSION", "SPIV" };
> > + const char const *names[] = { "ID", "VERSION", "SPIV" };
> > int timeout;
>
> Did you mean "const char * const" here?
doh! Yes, i did! Sorry I missed this email the first time around - my
procmail rules need a little work....
Greg
> -hpa
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [tip:x86/cleanups] x86, smpboot: Mark names[] array as const
2011-07-01 0:47 ` H. Peter Anvin
@ 2011-07-01 1:20 ` Brian Gerst
2011-07-01 1:21 ` H. Peter Anvin
0 siblings, 1 reply; 9+ messages in thread
From: Brian Gerst @ 2011-07-01 1:20 UTC (permalink / raw)
To: H. Peter Anvin
Cc: Greg Dietsche, H. Peter Anvin, mingo, linux-kernel,
Gregory.Dietsche, tglx, linux-tip-commits
On Thu, Jun 30, 2011 at 8:47 PM, H. Peter Anvin <hpa@linux.intel.com> wrote:
> On 06/30/2011 05:41 PM, Greg Dietsche wrote:
>> On Thu, Jun 30, 2011 at 05:25:36PM -0700, H. Peter Anvin wrote:
>>> On 06/30/2011 05:21 PM, tip-bot for Greg Dietsche wrote:
>>>> + const char const *names[] = { "ID", "VERSION", "SPIV" };
>>> ^^^^^^^^^^^^^^^^
>>>
>>> Doesn't make sense, patch removed...
>>>
>> could you explain a little more? I don't see my mistake.
>> it compiles and is running on my box currently.
>>
One const is for the strings, the other is for the array of pointers.
--
Brian Gerst
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [tip:x86/cleanups] x86, smpboot: Mark names[] array as const
2011-07-01 1:20 ` Brian Gerst
@ 2011-07-01 1:21 ` H. Peter Anvin
0 siblings, 0 replies; 9+ messages in thread
From: H. Peter Anvin @ 2011-07-01 1:21 UTC (permalink / raw)
To: Brian Gerst
Cc: Greg Dietsche, H. Peter Anvin, mingo, linux-kernel,
Gregory.Dietsche, tglx, linux-tip-commits
On 06/30/2011 06:20 PM, Brian Gerst wrote:
> On Thu, Jun 30, 2011 at 8:47 PM, H. Peter Anvin <hpa@linux.intel.com> wrote:
>> On 06/30/2011 05:41 PM, Greg Dietsche wrote:
>>> On Thu, Jun 30, 2011 at 05:25:36PM -0700, H. Peter Anvin wrote:
>>>> On 06/30/2011 05:21 PM, tip-bot for Greg Dietsche wrote:
>>>>> + const char const *names[] = { "ID", "VERSION", "SPIV" };
>>>> ^^^^^^^^^^^^^^^^
>>>>
>>>> Doesn't make sense, patch removed...
>>>>
>>> could you explain a little more? I don't see my mistake.
>>> it compiles and is running on my box currently.
>>>
>
> One const is for the strings, the other is for the array of pointers.
>
Yes, the syntax is wrong for that.
const char * const names[] is I think what he wanted.
-hpa
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2011-07-01 1:22 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-30 22:31 [PATCH] x86: smpboot: mark array as const Greg Dietsche
2011-07-01 0:21 ` [tip:x86/cleanups] x86, smpboot: Mark names[] " tip-bot for Greg Dietsche
2011-07-01 0:25 ` H. Peter Anvin
2011-07-01 0:41 ` Greg Dietsche
2011-07-01 0:47 ` H. Peter Anvin
2011-07-01 1:20 ` Brian Gerst
2011-07-01 1:21 ` H. Peter Anvin
2011-07-01 0:23 ` [PATCH] x86: smpboot: mark " H. Peter Anvin
2011-07-01 1:13 ` Greg Dietsche
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.