diff mbox series

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

Message ID 20211129231749.619469-1-colin.i.king@gmail.com (mailing list archive)
State Under Review
Commit b85a4d9628341c6a790354a28fd45c2cf7741273
Headers show
Series input: palmas-pwrbutton: make a couple of arrays static const | expand

Commit Message

Colin Ian King Nov. 29, 2021, 11:17 p.m. UTC
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.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/input/misc/palmas-pwrbutton.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/input/misc/palmas-pwrbutton.c b/drivers/input/misc/palmas-pwrbutton.c
index f9b05cf09ff5..1c7ceb20b5af 100644
--- a/drivers/input/misc/palmas-pwrbutton.c
+++ b/drivers/input/misc/palmas-pwrbutton.c
@@ -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));