power: supply: bd99954: make read-only array sub_status_reg
authorColin Ian King <colin.i.king@gmail.com>
Tue, 27 Jun 2023 12:17:07 +0000 (13:17 +0100)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Wed, 19 Jul 2023 21:12:36 +0000 (23:12 +0200)
Don't populate the read-only array on the stack, instead make it
static const.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/bd99954-charger.c

index 086dcf4..1ed1d9f 100644 (file)
@@ -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,
                };