linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Make gpiochip label const
@ 2008-08-12 20:39 Dmitry Baryshkov
  2008-08-12 22:06 ` David Brownell
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Baryshkov @ 2008-08-12 20:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Dmitry Baryshkov, David Brownell

Mark gpiochip label as a const char pointer.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
---
 include/asm-generic/gpio.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 6be061d..8ab874a 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -58,7 +58,7 @@ struct module;
  * is calculated by subtracting @base from the gpio number.
  */
 struct gpio_chip {
-	char			*label;
+	const char		*label;
 	struct module		*owner;
 
 	int			(*direction_input)(struct gpio_chip *chip,
-- 
1.5.6.3


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

* Re: [PATCH] Make gpiochip label const
  2008-08-12 20:39 [PATCH] Make gpiochip label const Dmitry Baryshkov
@ 2008-08-12 22:06 ` David Brownell
  2008-08-17 19:00   ` Dmitry Baryshkov
  0 siblings, 1 reply; 8+ messages in thread
From: David Brownell @ 2008-08-12 22:06 UTC (permalink / raw)
  To: linux-kernel, dbaryshkov; +Cc: dbrownell

> From dbaryshkov@gmail.com  Tue Aug 12 13:54:29 2008
> From: Dmitry Baryshkov <dbaryshkov@gmail.com>
> To: linux-kernel@vger.kernel.org
> Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>,
> 	David Brownell <dbrownell@users.sourceforge.net>
> Subject: [PATCH] Make gpiochip label const
> Date: Wed, 13 Aug 2008 00:39:48 +0400
>
> Mark gpiochip label as a const char pointer.
>
> Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
> Cc: David Brownell <dbrownell@users.sourceforge.net>

Acked-By: David Brownell <dbrownell@users.sourceforge.net>

> ---
>  include/asm-generic/gpio.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
> index 6be061d..8ab874a 100644
> --- a/include/asm-generic/gpio.h
> +++ b/include/asm-generic/gpio.h
> @@ -58,7 +58,7 @@ struct module;
>   * is calculated by subtracting @base from the gpio number.
>   */
>  struct gpio_chip {
> -	char			*label;
> +	const char		*label;
>  	struct module		*owner;
>  
>  	int			(*direction_input)(struct gpio_chip *chip,
> -- 
> 1.5.6.3
>

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

* Re: [PATCH] Make gpiochip label const
  2008-08-12 22:06 ` David Brownell
@ 2008-08-17 19:00   ` Dmitry Baryshkov
  2008-08-19  8:43     ` Andrew Morton
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Baryshkov @ 2008-08-17 19:00 UTC (permalink / raw)
  To: David Brownell; +Cc: linux-kernel, dbrownell

On Tue, Aug 12, 2008 at 03:06:19PM -0700, David Brownell wrote:
> > From dbaryshkov@gmail.com  Tue Aug 12 13:54:29 2008
> > From: Dmitry Baryshkov <dbaryshkov@gmail.com>
> > To: linux-kernel@vger.kernel.org
> > Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>,
> > 	David Brownell <dbrownell@users.sourceforge.net>
> > Subject: [PATCH] Make gpiochip label const
> > Date: Wed, 13 Aug 2008 00:39:48 +0400
> >
> > Mark gpiochip label as a const char pointer.
> >
> > Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
> > Cc: David Brownell <dbrownell@users.sourceforge.net>
> 
> Acked-By: David Brownell <dbrownell@users.sourceforge.net>
> 

Sorry to disturb, but will this make into 2.6.27-rc? Thanks.

-- 
With best wishes
Dmitry


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

* Re: [PATCH] Make gpiochip label const
  2008-08-17 19:00   ` Dmitry Baryshkov
@ 2008-08-19  8:43     ` Andrew Morton
  2008-08-19 11:13       ` Dmitry
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2008-08-19  8:43 UTC (permalink / raw)
  To: Dmitry Baryshkov; +Cc: David Brownell, linux-kernel, dbrownell

On Sun, 17 Aug 2008 23:00:35 +0400 Dmitry Baryshkov <dbaryshkov@gmail.com> wrote:

> On Tue, Aug 12, 2008 at 03:06:19PM -0700, David Brownell wrote:
> > > From dbaryshkov@gmail.com  Tue Aug 12 13:54:29 2008
> > > From: Dmitry Baryshkov <dbaryshkov@gmail.com>
> > > To: linux-kernel@vger.kernel.org
> > > Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>,
> > > 	David Brownell <dbrownell@users.sourceforge.net>
> > > Subject: [PATCH] Make gpiochip label const
> > > Date: Wed, 13 Aug 2008 00:39:48 +0400
> > >
> > > Mark gpiochip label as a const char pointer.
> > >
> > > Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
> > > Cc: David Brownell <dbrownell@users.sourceforge.net>
> > 
> > Acked-By: David Brownell <dbrownell@users.sourceforge.net>
> > 
> 
> Sorry to disturb, but will this make into 2.6.27-rc? Thanks.
> 

Ordinarily it would not.  Is there some reason why you think it should?

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

* Re: [PATCH] Make gpiochip label const
  2008-08-19  8:43     ` Andrew Morton
@ 2008-08-19 11:13       ` Dmitry
  2008-08-19 18:28         ` Andrew Morton
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry @ 2008-08-19 11:13 UTC (permalink / raw)
  To: Andrew Morton; +Cc: David Brownell, linux-kernel, dbrownell

2008/8/19 Andrew Morton <akpm@linux-foundation.org>:
> On Sun, 17 Aug 2008 23:00:35 +0400 Dmitry Baryshkov <dbaryshkov@gmail.com> wrote:
>
>> On Tue, Aug 12, 2008 at 03:06:19PM -0700, David Brownell wrote:
>> > > From dbaryshkov@gmail.com  Tue Aug 12 13:54:29 2008
>> > > From: Dmitry Baryshkov <dbaryshkov@gmail.com>
>> > > To: linux-kernel@vger.kernel.org
>> > > Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>,
>> > >   David Brownell <dbrownell@users.sourceforge.net>
>> > > Subject: [PATCH] Make gpiochip label const
>> > > Date: Wed, 13 Aug 2008 00:39:48 +0400
>> > >
>> > > Mark gpiochip label as a const char pointer.
>> > >
>> > > Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
>> > > Cc: David Brownell <dbrownell@users.sourceforge.net>
>> >
>> > Acked-By: David Brownell <dbrownell@users.sourceforge.net>
>> >
>>
>> Sorry to disturb, but will this make into 2.6.27-rc? Thanks.
>>
>
> Ordinarily it would not.  Is there some reason why you think it should?
>

It fixes lots of warnings (one per each instance of code filling the gpio chip)
and is pretty much small to honour inclusion IMO

-- 
With best wishes
Dmitry

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

* Re: [PATCH] Make gpiochip label const
  2008-08-19 11:13       ` Dmitry
@ 2008-08-19 18:28         ` Andrew Morton
  2008-08-20  8:39           ` Dmitry Baryshkov
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2008-08-19 18:28 UTC (permalink / raw)
  To: Dmitry; +Cc: david-b, linux-kernel, dbrownell

On Tue, 19 Aug 2008 15:13:47 +0400
Dmitry <dbaryshkov@gmail.com> wrote:

> 2008/8/19 Andrew Morton <akpm@linux-foundation.org>:
> > On Sun, 17 Aug 2008 23:00:35 +0400 Dmitry Baryshkov <dbaryshkov@gmail.com> wrote:
> >
> >> On Tue, Aug 12, 2008 at 03:06:19PM -0700, David Brownell wrote:
> >> > > From dbaryshkov@gmail.com  Tue Aug 12 13:54:29 2008
> >> > > From: Dmitry Baryshkov <dbaryshkov@gmail.com>
> >> > > To: linux-kernel@vger.kernel.org
> >> > > Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>,
> >> > >   David Brownell <dbrownell@users.sourceforge.net>
> >> > > Subject: [PATCH] Make gpiochip label const
> >> > > Date: Wed, 13 Aug 2008 00:39:48 +0400
> >> > >
> >> > > Mark gpiochip label as a const char pointer.
> >> > >
> >> > > Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
> >> > > Cc: David Brownell <dbrownell@users.sourceforge.net>
> >> >
> >> > Acked-By: David Brownell <dbrownell@users.sourceforge.net>
> >> >
> >>
> >> Sorry to disturb, but will this make into 2.6.27-rc? Thanks.
> >>
> >
> > Ordinarily it would not.  Is there some reason why you think it should?
> >
> 
> It fixes lots of warnings (one per each instance of code filling the gpio chip)


That should have been in the changelog!

When fixing warnings or compilations errors, the compiler output should
also be in the changelog.

I don't recall seeing such warnings and I cannot make them happen with
drivers/gpio/gpiolib.c or with drivers/gpio/max732x.c or with
drivers/gpio/pca953x.c.  So we still don't know what this patch
does :(

> and is pretty much small to honour inclusion IMO

Well sure it's small.  But converting things to `const' carries a
fairly high risk of adding new warnings or breaking the build.


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

* Re: [PATCH] Make gpiochip label const
  2008-08-19 18:28         ` Andrew Morton
@ 2008-08-20  8:39           ` Dmitry Baryshkov
  2008-08-20 15:50             ` David Brownell
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Baryshkov @ 2008-08-20  8:39 UTC (permalink / raw)
  To: Andrew Morton; +Cc: david-b, linux-kernel, dbrownell

On Tue, Aug 19, 2008 at 11:28:28AM -0700, Andrew Morton wrote:
> On Tue, 19 Aug 2008 15:13:47 +0400
> Dmitry <dbaryshkov@gmail.com> wrote:
> 
> > 2008/8/19 Andrew Morton <akpm@linux-foundation.org>:
> > > On Sun, 17 Aug 2008 23:00:35 +0400 Dmitry Baryshkov <dbaryshkov@gmail.com> wrote:
> > >
> > >> On Tue, Aug 12, 2008 at 03:06:19PM -0700, David Brownell wrote:
> > >> > > From dbaryshkov@gmail.com  Tue Aug 12 13:54:29 2008
> > >> > > From: Dmitry Baryshkov <dbaryshkov@gmail.com>
> > >> > > To: linux-kernel@vger.kernel.org
> > >> > > Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>,
> > >> > >   David Brownell <dbrownell@users.sourceforge.net>
> > >> > > Subject: [PATCH] Make gpiochip label const
> > >> > > Date: Wed, 13 Aug 2008 00:39:48 +0400
> > >> > >
> > >> > > Mark gpiochip label as a const char pointer.
> > >> > >
> > >> > > Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
> > >> > > Cc: David Brownell <dbrownell@users.sourceforge.net>
> > >> >
> > >> > Acked-By: David Brownell <dbrownell@users.sourceforge.net>
> > >> >
> > >>
> > >> Sorry to disturb, but will this make into 2.6.27-rc? Thanks.
> > >>
> > >
> > > Ordinarily it would not.  Is there some reason why you think it should?
> > >
> > 
> > It fixes lots of warnings (one per each instance of code filling the gpio chip)
> 
> 
> That should have been in the changelog!
> 
> When fixing warnings or compilations errors, the compiler output should
> also be in the changelog.

Thanks for the tip. It it written somewhere?

> I don't recall seeing such warnings and I cannot make them happen with
> drivers/gpio/gpiolib.c or with drivers/gpio/max732x.c or with
> drivers/gpio/pca953x.c.  So we still don't know what this patch
> does :(

Because both mentioned drivers set gpiochip->label to non-const string.
You can check arch/arm/common/scoop.c for example of driver showing
different behaviour:

  CHECK   /home/lumag/tosa-tree/arch/arm/common/scoop.c
/home/lumag/tosa-tree/arch/arm/common/scoop.c:250:22: warning: incorrect type in assignment (different modifiers)
/home/lumag/tosa-tree/arch/arm/common/scoop.c:250:22:    expected char *label
/home/lumag/tosa-tree/arch/arm/common/scoop.c:250:22:    got char const *
  CC      arch/arm/common/scoop.o
/home/lumag/tosa-tree/arch/arm/common/scoop.c: In function ‘scoop_probe’:
/home/lumag/tosa-tree/arch/arm/common/scoop.c:250: warning: assignment discards qualifiers from pointer target type

> 
> > and is pretty much small to honour inclusion IMO
> 
> Well sure it's small.  But converting things to `const' carries a
> fairly high risk of adding new warnings or breaking the build.

Should we stage it into linux-next?

-- 
With best wishes
Dmitry


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

* Re: [PATCH] Make gpiochip label const
  2008-08-20  8:39           ` Dmitry Baryshkov
@ 2008-08-20 15:50             ` David Brownell
  0 siblings, 0 replies; 8+ messages in thread
From: David Brownell @ 2008-08-20 15:50 UTC (permalink / raw)
  To: Dmitry Baryshkov; +Cc: Andrew Morton, linux-kernel

On Wednesday 20 August 2008, Dmitry Baryshkov wrote:
> > I don't recall seeing such warnings and I cannot make them happen with
> > drivers/gpio/gpiolib.c or with drivers/gpio/max732x.c or with
> > drivers/gpio/pca953x.c.  So we still don't know what this patch
> > does :(
> 
> Because both mentioned drivers set gpiochip->label to non-const string.
> You can check arch/arm/common/scoop.c for example of driver showing
> different behaviour:

You're doing it wrong -- in a small way, not a big one.  Instead of

	devptr->gpio.label = dev_name(&pdev->dev);

do

	devptr->gpio.label = "scoop";
	devptr->gpio.dev = &pdev->dev;

No warnings generated that way, and another field is set up...

- Dave


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

end of thread, other threads:[~2008-08-20 15:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-12 20:39 [PATCH] Make gpiochip label const Dmitry Baryshkov
2008-08-12 22:06 ` David Brownell
2008-08-17 19:00   ` Dmitry Baryshkov
2008-08-19  8:43     ` Andrew Morton
2008-08-19 11:13       ` Dmitry
2008-08-19 18:28         ` Andrew Morton
2008-08-20  8:39           ` Dmitry Baryshkov
2008-08-20 15:50             ` David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).