Skip to contentSkip to conversation

drivers: firmware: psci: drop duplicate const from psci_of_match

PATCH New Lorenzo Pieralisi 3 participants 4 messages Apr 20, 2016 – Apr 25, 2016 Power state coordination interface (psci)

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drivers: firmware: psci: drop duplicate const from psci_of_match

From: Jisheng Zhang <[email protected]>

This is to fix below sparse warning:
drivers/firmware/psci.c:mmm:nn: warning: duplicate const

---
 drivers/firmware/psci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/psci.c +1 -1
index 11bfee8..0ab477ba 100644
@@ -563,7 +563,7 @@ out_put_node:
 	return err;
 }
 
-static const struct of_device_id const psci_of_match[] __initconst = {
+static const struct of_device_id psci_of_match[] __initconst = {
 	{ .compatible = "arm,psci",	.data = psci_0_1_init},
 	{ .compatible = "arm,psci-0.2",	.data = psci_0_2_init},
 	{ .compatible = "arm,psci-1.0",	.data = psci_0_2_init},
Signature · 1 line
2.6.4
#1 lore raw

PATCH 2/2 drivers: firmware: psci: make two helper functions static

From: Jisheng Zhang <[email protected]>

psci_power_state_loses_context() and psci_power_state_is_valid are only used internally now, so make them static.

---
 drivers/firmware/psci.c | 4 ++--
 include/linux/psci.h    | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/firmware/psci.c +2 -2
index 0ab477ba..04f2ac5 100644
@@ -91,7 +91,7 @@ static inline bool psci_has_ext_power_state(void)
 				PSCI_1_0_FEATURES_CPU_SUSPEND_PF_MASK;
 }
 
-bool psci_power_state_loses_context(u32 state)
+static bool psci_power_state_loses_context(u32 state)
 {
 	const u32 mask = psci_has_ext_power_state() ?
 					PSCI_1_0_EXT_POWER_STATE_TYPE_MASK :
@@ -100,7 +100,7 @@ bool psci_power_state_loses_context(u32 state)
 	return state & mask;
 }
 
-bool psci_power_state_is_valid(u32 state)
+static bool psci_power_state_is_valid(u32 state)
 {
 	const u32 valid_mask = psci_has_ext_power_state() ?
 			       PSCI_1_0_EXT_POWER_STATE_MASK :
include/linux/psci.h +0 -2
index 393efe2..bdea1cb 100644
@@ -21,8 +21,6 @@
 #define PSCI_POWER_STATE_TYPE_POWER_DOWN	1
 
 bool psci_tos_resident_on(int cpu);
-bool psci_power_state_loses_context(u32 state);
-bool psci_power_state_is_valid(u32 state);
 
 int psci_cpu_init_idle(unsigned int cpu);
 int psci_cpu_suspend_enter(unsigned long index);
Signature · 1 line
2.6.4
#2 lore raw

PATCH 2/2 drivers: firmware: psci: make two helper functions static

Quoted 8 lines · On Wednesday 20 April 2016 11:20:28 Lorenzo Pieralisi wrote:

From: Jisheng Zhang <[email protected]>

psci_power_state_loses_context() and psci_power_state_is_valid are only used internally now, so make them static.

Applied both patches to next/drivers, thanks!

Arnd

maintainer
#3 lore raw

PATCH 1/2 drivers: firmware: psci: drop duplicate const from psci_of_match

In reply to Lorenzo Pieralisi
Quoted 7 lines · Lorenzo Pieralisi

From: Jisheng Zhang <[email protected]>

This is to fix below sparse warning:
drivers/firmware/psci.c:mmm:nn: warning: duplicate const

FWIW, for both:

Thanks for picking them up!

Mark.

Quoted 20 lines
---
 drivers/firmware/psci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/psci.c +1 -1
index 11bfee8..0ab477ba 100644
@@ -563,7 +563,7 @@ out_put_node:
 	return err;
 }
 
-static const struct of_device_id const psci_of_match[] __initconst = {
+static const struct of_device_id psci_of_match[] __initconst = {
 	{ .compatible = "arm,psci",	.data = psci_0_1_init},
 	{ .compatible = "arm,psci-0.2",	.data = psci_0_2_init},
 	{ .compatible = "arm,psci-1.0",	.data = psci_0_2_init},
Signature · 1 line
2.6.4