regulator: lp872x: make a const array static, makes object smaller
authorColin Ian King <colin.king@canonical.com>
Fri, 16 Oct 2020 22:22:35 +0000 (23:22 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 26 Oct 2020 20:56:58 +0000 (20:56 +0000)
Don't populate const array lp872x_num_regulators  on the stack but
instead make it static. Makes the object code smaller by 29 bytes.

Before:
   text    data     bss     dec     hex filename
  18441    4624      64   23129    5a59 drivers/regulator/lp872x.o

After:
   text    data     bss     dec     hex filename
  18316    4720      64   23100    5a3c drivers/regulator/lp872x.o

(gcc version 10.2.0)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20201016222235.686981-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/lp872x.c

index 303d7e2dc8384afe7003a06c1491c6034f3467dc..e84be29533f49df306417a54d8594e257676afa6 100644 (file)
@@ -892,7 +892,7 @@ static int lp872x_probe(struct i2c_client *cl, const struct i2c_device_id *id)
        struct lp872x *lp;
        struct lp872x_platform_data *pdata;
        int ret;
-       const int lp872x_num_regulators[] = {
+       static const int lp872x_num_regulators[] = {
                [LP8720] = LP8720_NUM_REGULATORS,
                [LP8725] = LP8725_NUM_REGULATORS,
        };