public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] printk.c: remove duplicate const
@ 2010-04-02  1:13 H Hartley Sweeten
  2010-04-02  1:20 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: H Hartley Sweeten @ 2010-04-02  1:13 UTC (permalink / raw)
  To: linux kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 680 bytes --]

Noticed during a sparse build.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>

---

diff --git a/kernel/printk.c b/kernel/printk.c
index 75077ad..9abc79c 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1457,7 +1457,7 @@ int kmsg_dump_unregister(struct kmsg_dumper *dumper)
 }
 EXPORT_SYMBOL_GPL(kmsg_dump_unregister);
 
-static const char const *kmsg_reasons[] = {
+static const char *kmsg_reasons[] = {
 	[KMSG_DUMP_OOPS]	= "oops",
 	[KMSG_DUMP_PANIC]	= "panic",
 	[KMSG_DUMP_KEXEC]	= "kexec",
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [PATCH] printk.c: remove duplicate const
  2010-04-02  1:13 [PATCH] printk.c: remove duplicate const H Hartley Sweeten
@ 2010-04-02  1:20 ` David Miller
  2010-04-02  1:28   ` H Hartley Sweeten
  2010-04-02  2:02   ` Andres Salomon
  0 siblings, 2 replies; 5+ messages in thread
From: David Miller @ 2010-04-02  1:20 UTC (permalink / raw)
  To: hartleys; +Cc: linux-kernel

From: H Hartley Sweeten <hartleys@visionengravers.com>
Date: Thu, 1 Apr 2010 20:13:27 -0500

> Noticed during a sparse build.
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>

Isn't it intentional?  The two consts mark different aspects
of the declaration const, both the pointers as well as the
contents pointed to.

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

* RE: [PATCH] printk.c: remove duplicate const
  2010-04-02  1:20 ` David Miller
@ 2010-04-02  1:28   ` H Hartley Sweeten
  2010-04-02  1:29     ` David Miller
  2010-04-02  2:02   ` Andres Salomon
  1 sibling, 1 reply; 5+ messages in thread
From: H Hartley Sweeten @ 2010-04-02  1:28 UTC (permalink / raw)
  To: David Miller; +Cc: linux-kernel@vger.kernel.org

On Thursday, April 01, 2010 6:20 PM, David Miller wrote:
> From: H Hartley Sweeten <hartleys@visionengravers.com>
> Date: Thu, 1 Apr 2010 20:13:27 -0500
> 
>> Noticed during a sparse build.
>> 
>> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> 
> Isn't it intentional?  The two consts mark different aspects
> of the declaration const, both the pointers as well as the
> contents pointed to.

Isn't that a C++ and not a C feature?

If it is valid in C then I guess the sparse people should be informed.

Regards,
Hartley

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

* Re: [PATCH] printk.c: remove duplicate const
  2010-04-02  1:28   ` H Hartley Sweeten
@ 2010-04-02  1:29     ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2010-04-02  1:29 UTC (permalink / raw)
  To: hartleys; +Cc: linux-kernel

From: H Hartley Sweeten <hartleys@visionengravers.com>
Date: Thu, 1 Apr 2010 20:28:33 -0500

> Isn't that a C++ and not a C feature?

I don't think so.

> If it is valid in C then I guess the sparse people should be informed.

Perhaps.

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

* Re: [PATCH] printk.c: remove duplicate const
  2010-04-02  1:20 ` David Miller
  2010-04-02  1:28   ` H Hartley Sweeten
@ 2010-04-02  2:02   ` Andres Salomon
  1 sibling, 0 replies; 5+ messages in thread
From: Andres Salomon @ 2010-04-02  2:02 UTC (permalink / raw)
  To: linux-kernel; +Cc: H Hartley Sweeten

On Thu, 01 Apr 2010 18:20:04 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:

> From: H Hartley Sweeten <hartleys@visionengravers.com>
> Date: Thu, 1 Apr 2010 20:13:27 -0500
> 
> > Noticed during a sparse build.
> > 
> > Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> 
> Isn't it intentional?  The two consts mark different aspects
> of the declaration const, both the pointers as well as the
> contents pointed to.


I believe that'd be -

static const char *const kmsg_reasons[]

rather than what was originally in the code -

static const char const *kmsg_reasons[]

Read right-to-left, the first is a constant pointer to a char constant;
the second is a pointer to a constant character constant.   I suspect
the first is what was intended.


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

end of thread, other threads:[~2010-04-02  1:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-02  1:13 [PATCH] printk.c: remove duplicate const H Hartley Sweeten
2010-04-02  1:20 ` David Miller
2010-04-02  1:28   ` H Hartley Sweeten
2010-04-02  1:29     ` David Miller
2010-04-02  2:02   ` Andres Salomon

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