Skip to contentSkip to conversation

power: supply: bd99954: make read-only array sub_status_reg

PATCH In review Colin Ian King 3 participants 3 messages Jun 27, 2023 – Jul 19, 2023

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

PATCH 1/1 power: supply: bd99954: make read-only array sub_status_reg

Don't populate the read-only array on the stack, instead make it static const.

---
 drivers/power/supply/bd99954-charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/bd99954-charger.c +1 -1
index 086dcf4033c1..1ed1d9f99fb3 100644
@@ -536,7 +536,7 @@ static irqreturn_t bd9995x_irq_handler_thread(int irq, void *private)
 
 	for_each_set_bit(i, &tmp, 7) {
 		int sub_status, sub_mask;
-		int sub_status_reg[] = {
+		static const int sub_status_reg[] = {
 			INT1_STATUS, INT2_STATUS, INT3_STATUS, INT4_STATUS,
 			INT5_STATUS, INT6_STATUS, INT7_STATUS,
 		};
Signature · 1 line
2.39.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Colin Ian King

Don't populate the read-only array on the stack, instead make it static const.

Thanks!

Yours,
-- Matti

Signature · 5 lines
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~