Skip to contentSkip to conversation

input: palmas-pwrbutton: make a couple of arrays static const

PATCH New Colin Ian King 1 participant 1 message Nov 29, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 input: palmas-pwrbutton: make a couple of arrays static const

Don't populate a couple of arrays on the stack but instead make them static const. Also makes the object code smaller by a few hundred bytes.

---
 drivers/input/misc/palmas-pwrbutton.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/input/misc/palmas-pwrbutton.c +2 -2
index f9b05cf09ff5..1c7ceb20b5af 100644
@@ -115,8 +115,8 @@ static void palmas_pwron_params_ofinit(struct device *dev,
 	struct device_node *np;
 	u32 val;
 	int i, error;
-	u8 lpk_times[] = { 6, 8, 10, 12 };
-	int pwr_on_deb_ms[] = { 15, 100, 500, 1000 };
+	static const u8 lpk_times[] = { 6, 8, 10, 12 };
+	static const int pwr_on_deb_ms[] = { 15, 100, 500, 1000 };
 
 	memset(config, 0, sizeof(*config));
 
Signature · 1 line
2.33.1