提交 12b136de 编写于 作者: C Colin Ian King 提交者: Linus Walleij

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: NColin Ian King <colin.king@canonical.com>
Acked-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 2bd6bf03
...@@ -204,9 +204,10 @@ static int uniphier_conf_pin_drive_get(struct pinctrl_dev *pctldev, ...@@ -204,9 +204,10 @@ static int uniphier_conf_pin_drive_get(struct pinctrl_dev *pctldev,
const struct pin_desc *desc = pin_desc_get(pctldev, pin); const struct pin_desc *desc = pin_desc_get(pctldev, pin);
enum uniphier_pin_drv_type type = enum uniphier_pin_drv_type type =
uniphier_pin_get_drv_type(desc->drv_data); uniphier_pin_get_drv_type(desc->drv_data);
const unsigned int strength_1bit[] = {4, 8}; static const unsigned int strength_1bit[] = {4, 8};
const unsigned int strength_2bit[] = {8, 12, 16, 20}; static const unsigned int strength_2bit[] = {8, 12, 16, 20};
const unsigned int strength_3bit[] = {4, 5, 7, 9, 11, 12, 14, 16}; static const unsigned int strength_3bit[] = {4, 5, 7, 9, 11, 12,
14, 16};
const unsigned int *supported_strength; const unsigned int *supported_strength;
unsigned int drvctrl, reg, shift, mask, width, val; unsigned int drvctrl, reg, shift, mask, width, val;
int ret; int ret;
...@@ -399,9 +400,10 @@ static int uniphier_conf_pin_drive_set(struct pinctrl_dev *pctldev, ...@@ -399,9 +400,10 @@ static int uniphier_conf_pin_drive_set(struct pinctrl_dev *pctldev,
const struct pin_desc *desc = pin_desc_get(pctldev, pin); const struct pin_desc *desc = pin_desc_get(pctldev, pin);
enum uniphier_pin_drv_type type = enum uniphier_pin_drv_type type =
uniphier_pin_get_drv_type(desc->drv_data); uniphier_pin_get_drv_type(desc->drv_data);
const unsigned int strength_1bit[] = {4, 8, -1}; static const unsigned int strength_1bit[] = {4, 8, -1};
const unsigned int strength_2bit[] = {8, 12, 16, 20, -1}; static const unsigned int strength_2bit[] = {8, 12, 16, 20, -1};
const unsigned int strength_3bit[] = {4, 5, 7, 9, 11, 12, 14, 16, -1}; static const unsigned int strength_3bit[] = {4, 5, 7, 9, 11, 12, 14,
16, -1};
const unsigned int *supported_strength; const unsigned int *supported_strength;
unsigned int drvctrl, reg, shift, mask, width, val; unsigned int drvctrl, reg, shift, mask, width, val;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册