{"id":812795,"url":"http://patchwork.ozlabs.org/api/patches/812795/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-gpio/patch/20170912112124.1143-1-colin.king@canonical.com/","project":{"id":42,"url":"http://patchwork.ozlabs.org/api/projects/42/?format=json","name":"Linux GPIO development","link_name":"linux-gpio","list_id":"linux-gpio.vger.kernel.org","list_email":"linux-gpio@vger.kernel.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170912112124.1143-1-colin.king@canonical.com>","list_archive_url":null,"date":"2017-09-12T11:21:24","name":"pinctrl: uniphier: make arrays static, reduces object code size","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"8bb39c4ae1aeb10a4709d4bb25ae35735cae1f4e","submitter":{"id":2900,"url":"http://patchwork.ozlabs.org/api/people/2900/?format=json","name":"Colin Ian King","email":"colin.king@canonical.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-gpio/patch/20170912112124.1143-1-colin.king@canonical.com/mbox/","series":[{"id":2672,"url":"http://patchwork.ozlabs.org/api/series/2672/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-gpio/list/?series=2672","date":"2017-09-12T11:21:24","name":"pinctrl: uniphier: make arrays static, reduces object code size","version":1,"mbox":"http://patchwork.ozlabs.org/series/2672/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/812795/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/812795/checks/","tags":{},"related":[],"headers":{"Return-Path":"<linux-gpio-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-gpio-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xs2Rs2DdBz9s7g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 21:21:28 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751392AbdILLV1 (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tTue, 12 Sep 2017 07:21:27 -0400","from youngberry.canonical.com ([91.189.89.112]:40103 \"EHLO\n\tyoungberry.canonical.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751326AbdILLV0 (ORCPT\n\t<rfc822; linux-gpio@vger.kernel.org>); Tue, 12 Sep 2017 07:21:26 -0400","from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost)\n\tby youngberry.canonical.com with esmtpsa\n\t(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76)\n\t(envelope-from <colin.king@canonical.com>)\n\tid 1drjFt-00062I-2v; Tue, 12 Sep 2017 11:21:25 +0000"],"From":"Colin King <colin.king@canonical.com>","To":"Linus Walleij <linus.walleij@linaro.org>,\n\tMasahiro Yamada <yamada.masahiro@socionext.com>,\n\tlinux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org","Cc":"kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org","Subject":"[PATCH] pinctrl: uniphier: make arrays static,\n\treduces object code size","Date":"Tue, 12 Sep 2017 12:21:24 +0100","Message-Id":"<20170912112124.1143-1-colin.king@canonical.com>","X-Mailer":"git-send-email 2.14.1","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"8bit","Sender":"linux-gpio-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-gpio.vger.kernel.org>","X-Mailing-List":"linux-gpio@vger.kernel.org"},"content":"From: Colin Ian King <colin.king@canonical.com>\n\nDon't populate const arrays on the stack, instead make them\nstatic.  Makes the object code smaller nearly 1000 bytes. Also\nline break wide lines to avoid checkpatch warnings.\n\nBefore:\n   text\t   data\t    bss\t    dec\t    hex\tfilename\n  13112\t   1996\t      0\t  15108\t   3b04\tpinctrl-uniphier-core.o\n\nAfter:\n   text\t   data\t    bss\t    dec\t    hex\tfilename\n  11642\t   2476\t      0\t  14118\t   3726\tpinctrl-uniphier-core.o\n\nSigned-off-by: Colin Ian King <colin.king@canonical.com>\n---\n drivers/pinctrl/uniphier/pinctrl-uniphier-core.c | 14 ++++++++------\n 1 file changed, 8 insertions(+), 6 deletions(-)","diff":"diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c\nindex f9267fabe6b0..26fda5c53e65 100644\n--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c\n+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c\n@@ -204,9 +204,10 @@ static int uniphier_conf_pin_drive_get(struct pinctrl_dev *pctldev,\n \tconst struct pin_desc *desc = pin_desc_get(pctldev, pin);\n \tenum uniphier_pin_drv_type type =\n \t\t\t\tuniphier_pin_get_drv_type(desc->drv_data);\n-\tconst unsigned int strength_1bit[] = {4, 8};\n-\tconst unsigned int strength_2bit[] = {8, 12, 16, 20};\n-\tconst unsigned int strength_3bit[] = {4, 5, 7, 9, 11, 12, 14, 16};\n+\tstatic const unsigned int strength_1bit[] = {4, 8};\n+\tstatic const unsigned int strength_2bit[] = {8, 12, 16, 20};\n+\tstatic const unsigned int strength_3bit[] = {4, 5, 7, 9, 11, 12,\n+\t\t\t\t\t\t     14, 16};\n \tconst unsigned int *supported_strength;\n \tunsigned int drvctrl, reg, shift, mask, width, val;\n \tint ret;\n@@ -399,9 +400,10 @@ static int uniphier_conf_pin_drive_set(struct pinctrl_dev *pctldev,\n \tconst struct pin_desc *desc = pin_desc_get(pctldev, pin);\n \tenum uniphier_pin_drv_type type =\n \t\t\t\tuniphier_pin_get_drv_type(desc->drv_data);\n-\tconst unsigned int strength_1bit[] = {4, 8, -1};\n-\tconst unsigned int strength_2bit[] = {8, 12, 16, 20, -1};\n-\tconst unsigned int strength_3bit[] = {4, 5, 7, 9, 11, 12, 14, 16, -1};\n+\tstatic const unsigned int strength_1bit[] = {4, 8, -1};\n+\tstatic const unsigned int strength_2bit[] = {8, 12, 16, 20, -1};\n+\tstatic const unsigned int strength_3bit[] = {4, 5, 7, 9, 11, 12, 14,\n+\t\t\t\t\t\t     16, -1};\n \tconst unsigned int *supported_strength;\n \tunsigned int drvctrl, reg, shift, mask, width, val;\n \n","prefixes":[]}