Skip to content

Commit 12b136d

Browse files
Colin Ian KingLinus Walleij
authored andcommitted
pinctrl: uniphier: make arrays static, reduces object code size
Don't populate const arrays on the stack, instead make them static. Makes the object code smaller nearly 1000 bytes. Also line break wide lines to avoid checkpatch warnings. Before: text data bss dec hex filename 13112 1996 0 15108 3b04 pinctrl-uniphier-core.o After: text data bss dec hex filename 11642 2476 0 14118 3726 pinctrl-uniphier-core.o Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 2bd6bf0 commit 12b136d

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

‎drivers/pinctrl/uniphier/pinctrl-uniphier-core.c‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,10 @@ static int uniphier_conf_pin_drive_get(struct pinctrl_dev *pctldev,
204204
const struct pin_desc *desc = pin_desc_get(pctldev, pin);
205205
enum uniphier_pin_drv_type type =
206206
uniphier_pin_get_drv_type(desc->drv_data);
207-
const unsigned int strength_1bit[] = {4, 8};
208-
const unsigned int strength_2bit[] = {8, 12, 16, 20};
209-
const unsigned int strength_3bit[] = {4, 5, 7, 9, 11, 12, 14, 16};
207+
static const unsigned int strength_1bit[] = {4, 8};
208+
static const unsigned int strength_2bit[] = {8, 12, 16, 20};
209+
static const unsigned int strength_3bit[] = {4, 5, 7, 9, 11, 12,
210+
14, 16};
210211
const unsigned int *supported_strength;
211212
unsigned int drvctrl, reg, shift, mask, width, val;
212213
int ret;
@@ -399,9 +400,10 @@ static int uniphier_conf_pin_drive_set(struct pinctrl_dev *pctldev,
399400
const struct pin_desc *desc = pin_desc_get(pctldev, pin);
400401
enum uniphier_pin_drv_type type =
401402
uniphier_pin_get_drv_type(desc->drv_data);
402-
const unsigned int strength_1bit[] = {4, 8, -1};
403-
const unsigned int strength_2bit[] = {8, 12, 16, 20, -1};
404-
const unsigned int strength_3bit[] = {4, 5, 7, 9, 11, 12, 14, 16, -1};
403+
static const unsigned int strength_1bit[] = {4, 8, -1};
404+
static const unsigned int strength_2bit[] = {8, 12, 16, 20, -1};
405+
static const unsigned int strength_3bit[] = {4, 5, 7, 9, 11, 12, 14,
406+
16, -1};
405407
const unsigned int *supported_strength;
406408
unsigned int drvctrl, reg, shift, mask, width, val;
407409

0 commit comments

Comments
 (0)