Received: by 10.213.65.68 with SMTP id h4csp1870171imn; Thu, 5 Apr 2018 05:20:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx48j9qHK0Php50ix4nvmvI3SLY9JQryt33H/7bjEdCLN4WyXEePkR/J5dgpwsyw+dzvmUUDG X-Received: by 10.98.85.197 with SMTP id j188mr16933712pfb.86.1522930836765; Thu, 05 Apr 2018 05:20:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522930836; cv=none; d=google.com; s=arc-20160816; b=e9whLwHUhJ1kJhwHnMrFecbsTq9zcViJ8UIVJ0rqDOJlCSLnAQmndVAih36q1aTygv NjwQgjcFqEs6xbYPBNz8S245J6CUvL8g0yVmQ2RgcJ0K0kKWkiKX5EdDB7/jlOokwgOp rlmpGVGjffMnqgJqKhjCfCAFIO5VZOdzlaziHJyI8kiY1jgQUkwxj9xh4W0+Byjt5bxl YH0HroYP0ckcFQUPTX10e+aJA3+eSTQdmLchzn3eR1+IUCQ89JCBIufwdPuGfal9bHkf MknT8Rpx//UaEU6SqOs74MUK4hSqQQbsRre9Ysr8g/hAhaxlgDYYhYl4Tl1r0qXqGLKX v7/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=SF11CH+ZMFdGHPkaPVomzgWykm2qMST3SyooCfQwA1Q=; b=FhvGRdPsU3JYnkN4wJX8j3GCwkI9W1/1baEW5tELwJq3Y6CI0Puwa2M3STk3aV3hyU 86IqU4XFVxjmgvcQ30dMDphp43DmrRfTpepk0pbgFylNhAoyv1RKvoaX6l/rILyikBQp Re219gcyJTtMBOWrFpG2GwmTVF73JyXjrOWPEiCEj9YClAWXCyJGr4eOe6vHVXiqQadz MjIsqwUGG6lvyXZszqiOLXPeN19F1ML4GTIiN3BlmzDojSc+8jmK8ErJn7Xomv1HRYXz 2eLEGck0ecH5kqpMTGJ7Uy7e49ieaTc0tPFO8peAdIK1+Ozz7IFw088bwXUx9lu6+ae9 QPAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gOklT1FU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b38-v6si5991285pla.124.2018.04.05.05.20.22; Thu, 05 Apr 2018 05:20:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gOklT1FU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751332AbeDEMTR (ORCPT + 99 others); Thu, 5 Apr 2018 08:19:17 -0400 Received: from mail-yb0-f195.google.com ([209.85.213.195]:46172 "EHLO mail-yb0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751038AbeDEMTP (ORCPT ); Thu, 5 Apr 2018 08:19:15 -0400 Received: by mail-yb0-f195.google.com with SMTP id e5-v6so8090375ybq.13; Thu, 05 Apr 2018 05:19:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=SF11CH+ZMFdGHPkaPVomzgWykm2qMST3SyooCfQwA1Q=; b=gOklT1FUnvEW1yonyEvqVT47jgOHsY3d1t1QPxgtW/+WXqSNFqPbe3JCyhwZlVfZ5q Vcdlru7WoVhqFZOE5KDETnaP6UgShYvVI5sI7fVZJCCmLVfWuFhylu/v1OaMy4FzKuuY TIJrOhjwfZop6jK3vNOX0XRm4GggIb5I4JopS83ItWAHtfKGxJBRvTdENmkg/M2Ouj8u VjR49cFRimC5HuQGAm02WlvyPRwkzj/sGUmsrkqSfG3dmam+VTTCmYeM35O7c4L3RrHp cvpWppi8jzM4nMHt8jdn6YKe1kyFiI2jNbdaD7/Od+DtnIlSK0mIPt8LYLNc/cirZt4Y x6MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=SF11CH+ZMFdGHPkaPVomzgWykm2qMST3SyooCfQwA1Q=; b=bhe8KIYVM6xgIgZ/XbxbAI0jrSeHf9SDG4puFnGLGcBqhhkE8jd6MtZRZHg8scb3PZ EQI0nAz9kfYpgx2c+mQunNviD8t2KV7dRMTx84BSHIgcoPdtoJxxz1JRCD2j25Q2a67Y j0LzTIp0HnHz4YNJ7gIwez8DYQ/FtFXyD2FJN9FJOz8VsLY1cRF17PxNtcXHs1LMqAhD R5w1PQipYzu/oy48bTJ5cSDdjoMEMWBvMRuXla3zlDmp0HwhQC6MbOZ0j3h+eVA0I/ua dMXPgtclIT9NmCosfC1kEhSWn14rmFJ4P1uKzeXF62VkBf4hwjuq/xHkqkNfXx8HtK/S ABdQ== X-Gm-Message-State: ALQs6tD665WCH4cKgdDhpc36m4oVnNM9BZTg1WgRdyYwcJH48b+3VAb4 jyOLSVJjMC8HdkWUEWNlcJM= X-Received: by 2002:a25:9011:: with SMTP id s17-v6mr5717521ybl.414.1522930754695; Thu, 05 Apr 2018 05:19:14 -0700 (PDT) Received: from sophia ([72.188.97.40]) by smtp.gmail.com with ESMTPSA id b66sm3099079ywc.69.2018.04.05.05.19.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Apr 2018 05:19:13 -0700 (PDT) Date: Thu, 5 Apr 2018 08:19:06 -0400 From: William Breathitt Gray To: Colin King Cc: Linus Walleij , linux-gpio@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] gpio: 104-dio-48e: make array 'ports' static, shrinks object size Message-ID: <20180405121906.GA6274@sophia> References: <20180405120012.7671-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180405120012.7671-1-colin.king@canonical.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 05, 2018 at 01:00:12PM +0100, Colin King wrote: >From: Colin Ian King > >Don't populate the const read-only array 'ports' on the stack but instead >make it static. Makes the object code smaller by over 100 buytes: > >Before: > text data bss dec hex filename > 10959 4952 832 16743 4167 drivers/gpio/gpio-104-dio-48e.o > >After: > text data bss dec hex filename > 10790 5008 832 16630 40f6 drivers/gpio/gpio-104-dio-48e.o > >(gcc version 7.2.0 x86_64) > >Signed-off-by: Colin Ian King >--- > drivers/gpio/gpio-104-dio-48e.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/drivers/gpio/gpio-104-dio-48e.c b/drivers/gpio/gpio-104-dio-48e.c >index 31e22c93e844..9c4e07fcb74b 100644 >--- a/drivers/gpio/gpio-104-dio-48e.c >+++ b/drivers/gpio/gpio-104-dio-48e.c >@@ -188,7 +188,7 @@ static int dio48e_gpio_get_multiple(struct gpio_chip *chip, unsigned long *mask, > { > struct dio48e_gpio *const dio48egpio = gpiochip_get_data(chip); > size_t i; >- const size_t ports[] = { 0, 1, 2, 4, 5, 6 }; >+ static const size_t ports[] = { 0, 1, 2, 4, 5, 6 }; > const unsigned int gpio_reg_size = 8; > unsigned int bits_offset; > size_t word_index; >-- >2.15.1 > If this makes gpio-104-dio-48e.o smaller, then it may be worthwhile to apply similar changes to gpio-104-idi-48.c and gpio-gpio-mm.c which have similar get_multiple callback implementations. Acked-by: William Breathitt Gray