Skip to contentSkip to conversation

misc: sram: remove useless #ifdef

PATCH In review Arnd Bergmann 4 participants 8 messages Nov 22, 2016 – Nov 30, 2016 Char and misc drivers

lore
Share & tools
lore

Arnd Bergmann

author maintainer
#0 lore raw

PATCH 1/1 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")
---
 drivers/misc/sram.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/misc/sram.c +1 -3
index b0d4dd9b0586..b33ab8ce47ab 100644
@@ -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,
Signature · 1 line
2.9.0
Reviewed-by on v1 1/1
#1 lore raw

Hi Arnd,

Quoted 5 lines · Arnd Bergmann

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]

Quoted 8 lines

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?

Quoted 2 lines

---

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

--
Best wishes,
Vladimir

#2 lore raw

Hi,

Quoted 12 lines · Vladimir Zapolskiy

Hi Arnd,

Quoted 9 lines · Arnd Bergmann

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.

Quoted 8 lines
Quoted 4 lines

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.

Signature · 3 lines
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
author maintainer
#3 lore raw
In reply to Vladimir Zapolskiy
Quoted 19 lines · CET Vladimir Zapolskiy
Quoted 5 lines · Arnd Bergmann

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]

Quoted 8 lines

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?

Quoted 7 lines
Quoted 2 lines

---

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

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

Arnd

#4 lore raw
In reply to Arnd Bergmann
Quoted 5 lines · Arnd Bergmann

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]

Quoted 8 lines

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

#5 lore raw
Quoted 10 lines · Greg Kroah-Hartman
Quoted 9 lines · Arnd Bergmann

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.

Quoted 8 lines
Quoted 4 lines

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)

Signature · 3 lines
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#6 lore raw
Quoted 14 lines · Alexandre Belloni
Quoted 13 lines · Greg Kroah-Hartman
Quoted 12 lines · Arnd Bergmann

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.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line
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!

#7 lore raw
Quoted 17 lines · Greg Kroah-Hartman
Quoted 16 lines · Alexandre Belloni
Quoted 15 lines · Greg Kroah-Hartman
Quoted 13 lines · Arnd Bergmann

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")
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

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.

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