Skip to contentSkip to conversation

Input: dlink-dir685-touchkeys: Make array bl_data static const

PATCH In review Colin Ian King 3 participants 3 messages Oct 5, 2022 – Oct 6, 2022

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

PATCH 1/1 Input: dlink-dir685-touchkeys: Make array bl_data static const

Don't populate the read-only array bl_data on the stack but instead make it static const. Also makes the object code a little smaller.

---
 drivers/input/keyboard/dlink-dir685-touchkeys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/dlink-dir685-touchkeys.c +1 -1
index a69dcc3bd30c..7db7fb175869 100644
@@ -64,7 +64,7 @@ static int dir685_tk_probe(struct i2c_client *client,
 {
 	struct dir685_touchkeys *tk;
 	struct device *dev = &client->dev;
-	u8 bl_data[] = { 0xa7, 0x40 };
+	static const u8 bl_data[] = { 0xa7, 0x40 };
 	int err;
 	int i;
 
Signature · 1 line
2.37.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Colin Ian King

Don't populate the read-only array bl_data on the stack but instead make it static const. Also makes the object code a little smaller.

Quoted 19 lines
---
 drivers/input/keyboard/dlink-dir685-touchkeys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/dlink-dir685-touchkeys.c +1 -1
index a69dcc3bd30c..7db7fb175869 100644
@@ -64,7 +64,7 @@ static int dir685_tk_probe(struct i2c_client *client,
 {
 	struct dir685_touchkeys *tk;
 	struct device *dev = &client->dev;
-	u8 bl_data[] = { 0xa7, 0x40 };
+	static const u8 bl_data[] = { 0xa7, 0x40 };
 	int err;
 	int i;
 
Signature · 1 line
2.37.3