2016-11-22 14:31:19

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH] misc: sram: remove useless #ifdef

A recent patch added a new function that is now unused whenever
CONFIG_OF is disabled:

drivers/misc/sram.c:342:12: error: 'atmel_securam_wait' defined but not used [-Werror=unused-function]

There is actually no reason for the #ifdef, because the driver
currently cannot be used in a meaningful way without CONFIG_OF,
and there is no compile-time dependency.

Removing that #ifdef and the respective of_match_ptr() avoids the
warning and simplifies the driver slightly.

Fixes: 2ae2e28852f2 ("misc: sram: add Atmel securam support")
Signed-off-by: Arnd Bergmann <[email protected]>
---
drivers/misc/sram.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
index b0d4dd9b0586..b33ab8ce47ab 100644
--- a/drivers/misc/sram.c
+++ b/drivers/misc/sram.c
@@ -353,13 +353,11 @@ static int atmel_securam_wait(void)
10000, 500000);
}

-#ifdef CONFIG_OF
static const struct of_device_id sram_dt_ids[] = {
{ .compatible = "mmio-sram" },
{ .compatible = "atmel,sama5d2-securam", .data = atmel_securam_wait },
{}
};
-#endif

static int sram_probe(struct platform_device *pdev)
{
@@ -443,7 +441,7 @@ static int sram_remove(struct platform_device *pdev)
static struct platform_driver sram_driver = {
.driver = {
.name = "sram",
- .of_match_table = of_match_ptr(sram_dt_ids),
+ .of_match_table = sram_dt_ids,
},
.probe = sram_probe,
.remove = sram_remove,
--
2.9.0


2016-11-22 17:47:58

by Vladimir Zapolskiy

[permalink] [raw]
Subject: Re: [PATCH] misc: sram: remove useless #ifdef

Hi Arnd,

On 11/22/2016 04:30 PM, Arnd Bergmann wrote:
> A recent patch added a new function that is now unused whenever
> CONFIG_OF is disabled:
>
> drivers/misc/sram.c:342:12: error: 'atmel_securam_wait' defined but not used [-Werror=unused-function]
>
> There is actually no reason for the #ifdef, because the driver
> currently cannot be used in a meaningful way without CONFIG_OF,
> and there is no compile-time dependency.
>
> Removing that #ifdef and the respective of_match_ptr() avoids the
> warning and simplifies the driver slightly.
>
> Fixes: 2ae2e28852f2 ("misc: sram: add Atmel securam support")

I can not find the referenced commit on Torvald's branch,
won't it be rebased and get a changed commit hash after merge?

> Signed-off-by: Arnd Bergmann <[email protected]>
> ---

The change itself is good, thank you for the fix.

Reviewed-by: Vladimir Zapolskiy <[email protected]>

--
Best wishes,
Vladimir

2016-11-22 17:59:56

by Alexandre Belloni

[permalink] [raw]
Subject: Re: [PATCH] misc: sram: remove useless #ifdef

Hi,

On 22/11/2016 at 19:47:52 +0200, Vladimir Zapolskiy wrote :
> Hi Arnd,
>
> On 11/22/2016 04:30 PM, Arnd Bergmann wrote:
> > A recent patch added a new function that is now unused whenever
> > CONFIG_OF is disabled:
> >
> > drivers/misc/sram.c:342:12: error: 'atmel_securam_wait' defined but not used [-Werror=unused-function]
> >
> > There is actually no reason for the #ifdef, because the driver
> > currently cannot be used in a meaningful way without CONFIG_OF,
> > and there is no compile-time dependency.
> >
> > Removing that #ifdef and the respective of_match_ptr() avoids the
> > warning and simplifies the driver slightly.
> >
> > Fixes: 2ae2e28852f2 ("misc: sram: add Atmel securam support")
>
> I can not find the referenced commit on Torvald's branch,
> won't it be rebased and get a changed commit hash after merge?
>

No, it won't be rebased, the merge will keep the commit ID.


--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

2016-11-29 19:41:54

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] misc: sram: remove useless #ifdef

On Tue, Nov 22, 2016 at 03:30:54PM +0100, Arnd Bergmann wrote:
> A recent patch added a new function that is now unused whenever
> CONFIG_OF is disabled:
>
> drivers/misc/sram.c:342:12: error: 'atmel_securam_wait' defined but not used [-Werror=unused-function]
>
> There is actually no reason for the #ifdef, because the driver
> currently cannot be used in a meaningful way without CONFIG_OF,
> and there is no compile-time dependency.
>
> Removing that #ifdef and the respective of_match_ptr() avoids the
> warning and simplifies the driver slightly.
>
> Fixes: 2ae2e28852f2 ("misc: sram: add Atmel securam support")

What tree is this commit in? I can't seem to find it in one of mine, am
I just missing it somewhere?

thanks,

greg "I have too many git trees" k-h

2016-11-29 19:54:10

by Alexandre Belloni

[permalink] [raw]
Subject: Re: [PATCH] misc: sram: remove useless #ifdef

On 29/11/2016 at 20:41:54 +0100, Greg Kroah-Hartman wrote :
> On Tue, Nov 22, 2016 at 03:30:54PM +0100, Arnd Bergmann wrote:
> > A recent patch added a new function that is now unused whenever
> > CONFIG_OF is disabled:
> >
> > drivers/misc/sram.c:342:12: error: 'atmel_securam_wait' defined but not used [-Werror=unused-function]
> >
> > There is actually no reason for the #ifdef, because the driver
> > currently cannot be used in a meaningful way without CONFIG_OF,
> > and there is no compile-time dependency.
> >
> > Removing that #ifdef and the respective of_match_ptr() avoids the
> > warning and simplifies the driver slightly.
> >
> > Fixes: 2ae2e28852f2 ("misc: sram: add Atmel securam support")
>
> What tree is this commit in? I can't seem to find it in one of mine, am
> I just missing it somewhere?
>

It is in arm-soc (it went through the mach-at91 tree)

--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

2016-11-29 20:01:50

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] misc: sram: remove useless #ifdef

On Tue, Nov 29, 2016 at 08:54:00PM +0100, Alexandre Belloni wrote:
> On 29/11/2016 at 20:41:54 +0100, Greg Kroah-Hartman wrote :
> > On Tue, Nov 22, 2016 at 03:30:54PM +0100, Arnd Bergmann wrote:
> > > A recent patch added a new function that is now unused whenever
> > > CONFIG_OF is disabled:
> > >
> > > drivers/misc/sram.c:342:12: error: 'atmel_securam_wait' defined but not used [-Werror=unused-function]
> > >
> > > There is actually no reason for the #ifdef, because the driver
> > > currently cannot be used in a meaningful way without CONFIG_OF,
> > > and there is no compile-time dependency.
> > >
> > > Removing that #ifdef and the respective of_match_ptr() avoids the
> > > warning and simplifies the driver slightly.
> > >
> > > Fixes: 2ae2e28852f2 ("misc: sram: add Atmel securam support")
> >
> > What tree is this commit in? I can't seem to find it in one of mine, am
> > I just missing it somewhere?
> >
>
> It is in arm-soc (it went through the mach-at91 tree)

Ah, ok, nothing I can do about it then, nice!

2016-11-29 23:31:09

by Alexandre Belloni

[permalink] [raw]
Subject: Re: [PATCH] misc: sram: remove useless #ifdef

On 29/11/2016 at 21:01:53 +0100, Greg Kroah-Hartman wrote :
> On Tue, Nov 29, 2016 at 08:54:00PM +0100, Alexandre Belloni wrote:
> > On 29/11/2016 at 20:41:54 +0100, Greg Kroah-Hartman wrote :
> > > On Tue, Nov 22, 2016 at 03:30:54PM +0100, Arnd Bergmann wrote:
> > > > A recent patch added a new function that is now unused whenever
> > > > CONFIG_OF is disabled:
> > > >
> > > > drivers/misc/sram.c:342:12: error: 'atmel_securam_wait' defined but not used [-Werror=unused-function]
> > > >
> > > > There is actually no reason for the #ifdef, because the driver
> > > > currently cannot be used in a meaningful way without CONFIG_OF,
> > > > and there is no compile-time dependency.
> > > >
> > > > Removing that #ifdef and the respective of_match_ptr() avoids the
> > > > warning and simplifies the driver slightly.
> > > >
> > > > Fixes: 2ae2e28852f2 ("misc: sram: add Atmel securam support")
> > >
> > > What tree is this commit in? I can't seem to find it in one of mine, am
> > > I just missing it somewhere?
> > >
> >
> > It is in arm-soc (it went through the mach-at91 tree)
>
> Ah, ok, nothing I can do about it then, nice!

Yeah, I was thinking Arnd would take it directly.

--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

2016-11-30 14:45:17

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH] misc: sram: remove useless #ifdef

On Tuesday, November 22, 2016 7:47:52 PM CET Vladimir Zapolskiy wrote:
>
> On 11/22/2016 04:30 PM, Arnd Bergmann wrote:
> > A recent patch added a new function that is now unused whenever
> > CONFIG_OF is disabled:
> >
> > drivers/misc/sram.c:342:12: error: 'atmel_securam_wait' defined but not used [-Werror=unused-function]
> >
> > There is actually no reason for the #ifdef, because the driver
> > currently cannot be used in a meaningful way without CONFIG_OF,
> > and there is no compile-time dependency.
> >
> > Removing that #ifdef and the respective of_match_ptr() avoids the
> > warning and simplifies the driver slightly.
> >
> > Fixes: 2ae2e28852f2 ("misc: sram: add Atmel securam support")
>
> I can not find the referenced commit on Torvald's branch,
> won't it be rebased and get a changed commit hash after merge?
>
> > Signed-off-by: Arnd Bergmann <[email protected]>
> > ---
>
> The change itself is good, thank you for the fix.
>
> Reviewed-by: Vladimir Zapolskiy <[email protected]>
>

Applied on arm-soc/next/drivers now, thanks.

Arnd