linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] gpio: davinci: drop pointless static qualifier
@ 2019-01-23  8:49 YueHaibing
  2019-01-23 10:32 ` Keerthy
  0 siblings, 1 reply; 3+ messages in thread
From: YueHaibing @ 2019-01-23  8:49 UTC (permalink / raw)
  To: j-keerthy, linus.walleij, bgolaszewski
  Cc: linux-kernel, linux-gpio, YueHaibing

There is no need to have the 'gpio_unbanked' variable static since
new value always be assigned before use it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/gpio/gpio-davinci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
index bdb29e5..f250454 100644
--- a/drivers/gpio/gpio-davinci.c
+++ b/drivers/gpio/gpio-davinci.c
@@ -465,7 +465,7 @@ static const struct irq_domain_ops davinci_gpio_irq_ops = {
 
 static struct irq_chip *davinci_gpio_get_irq_chip(unsigned int irq)
 {
-	static struct irq_chip_type gpio_unbanked;
+	struct irq_chip_type gpio_unbanked;
 
 	gpio_unbanked = *irq_data_get_chip_type(irq_get_irq_data(irq));
 
@@ -474,7 +474,7 @@ static struct irq_chip *davinci_gpio_get_irq_chip(unsigned int irq)
 
 static struct irq_chip *keystone_gpio_get_irq_chip(unsigned int irq)
 {
-	static struct irq_chip gpio_unbanked;
+	struct irq_chip gpio_unbanked;
 
 	gpio_unbanked = *irq_get_chip(irq);
 	return &gpio_unbanked;
-- 
2.7.0



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

* Re: [PATCH -next] gpio: davinci: drop pointless static qualifier
  2019-01-23  8:49 [PATCH -next] gpio: davinci: drop pointless static qualifier YueHaibing
@ 2019-01-23 10:32 ` Keerthy
  2019-01-23 16:12   ` Bartosz Golaszewski
  0 siblings, 1 reply; 3+ messages in thread
From: Keerthy @ 2019-01-23 10:32 UTC (permalink / raw)
  To: YueHaibing, linus.walleij, bgolaszewski; +Cc: linux-kernel, linux-gpio

On 23/01/19 2:19 PM, YueHaibing wrote:
> There is no need to have the 'gpio_unbanked' variable static since
> new value always be assigned before use it.

Acked-by: Keerthy <j-keerthy@ti.com>

> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/gpio/gpio-davinci.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
> index bdb29e5..f250454 100644
> --- a/drivers/gpio/gpio-davinci.c
> +++ b/drivers/gpio/gpio-davinci.c
> @@ -465,7 +465,7 @@ static const struct irq_domain_ops davinci_gpio_irq_ops = {
>  
>  static struct irq_chip *davinci_gpio_get_irq_chip(unsigned int irq)
>  {
> -	static struct irq_chip_type gpio_unbanked;
> +	struct irq_chip_type gpio_unbanked;
>  
>  	gpio_unbanked = *irq_data_get_chip_type(irq_get_irq_data(irq));
>  
> @@ -474,7 +474,7 @@ static struct irq_chip *davinci_gpio_get_irq_chip(unsigned int irq)
>  
>  static struct irq_chip *keystone_gpio_get_irq_chip(unsigned int irq)
>  {
> -	static struct irq_chip gpio_unbanked;
> +	struct irq_chip gpio_unbanked;
>  
>  	gpio_unbanked = *irq_get_chip(irq);
>  	return &gpio_unbanked;
> 


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

* Re: [PATCH -next] gpio: davinci: drop pointless static qualifier
  2019-01-23 10:32 ` Keerthy
@ 2019-01-23 16:12   ` Bartosz Golaszewski
  0 siblings, 0 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2019-01-23 16:12 UTC (permalink / raw)
  To: Keerthy; +Cc: YueHaibing, Linus Walleij, LKML, linux-gpio

śr., 23 sty 2019 o 11:32 Keerthy <j-keerthy@ti.com> napisał(a):
>
> On 23/01/19 2:19 PM, YueHaibing wrote:
> > There is no need to have the 'gpio_unbanked' variable static since
> > new value always be assigned before use it.
>
> Acked-by: Keerthy <j-keerthy@ti.com>
>
> >
> > Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> > ---
> >  drivers/gpio/gpio-davinci.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
> > index bdb29e5..f250454 100644
> > --- a/drivers/gpio/gpio-davinci.c
> > +++ b/drivers/gpio/gpio-davinci.c
> > @@ -465,7 +465,7 @@ static const struct irq_domain_ops davinci_gpio_irq_ops = {
> >
> >  static struct irq_chip *davinci_gpio_get_irq_chip(unsigned int irq)
> >  {
> > -     static struct irq_chip_type gpio_unbanked;
> > +     struct irq_chip_type gpio_unbanked;
> >
> >       gpio_unbanked = *irq_data_get_chip_type(irq_get_irq_data(irq));
> >
> > @@ -474,7 +474,7 @@ static struct irq_chip *davinci_gpio_get_irq_chip(unsigned int irq)
> >
> >  static struct irq_chip *keystone_gpio_get_irq_chip(unsigned int irq)
> >  {
> > -     static struct irq_chip gpio_unbanked;
> > +     struct irq_chip gpio_unbanked;
> >
> >       gpio_unbanked = *irq_get_chip(irq);
> >       return &gpio_unbanked;
> >
>

Good catch! While it would probably never result in a race condition
as it is always called from probe(), it's still wrong so patch
applied.

Thanks,
Bart

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

end of thread, other threads:[~2019-01-23 16:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-23  8:49 [PATCH -next] gpio: davinci: drop pointless static qualifier YueHaibing
2019-01-23 10:32 ` Keerthy
2019-01-23 16:12   ` Bartosz Golaszewski

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).