Received: by 10.213.65.68 with SMTP id h4csp1849282imn; Thu, 5 Apr 2018 05:01:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx48uW3J6yTw8LKh2RIYsObUCIwTTUIZKdr2OzvJ0ldkX9BHC0vIEJ9H5VsgO/wHcf5veAdh/ X-Received: by 2002:a17:902:6c4f:: with SMTP id h15-v6mr23102208pln.33.1522929704208; Thu, 05 Apr 2018 05:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522929704; cv=none; d=google.com; s=arc-20160816; b=xV5cU11QdKU7lkCnOdxqZjeDV1/vsBKswAMYJOHtsBtEjQOp3s7vIpkGrnYcypNxJe uXzW+pyQ5J1wQmGsHz8zzhCGkigsmJoYAw5G48ZoM9/qNnRu7wd6HrZUUZfmAnRt0jB/ 8EH4+nd+XyhYfCS+QuDGQnjc9r4Rh4QVVnfoEhI2fK65wXwEH5RVuCdJmrnecz6vHxSw zrF44jsqzKVMoWJAPyGv6yqT9j8hs44SjcaLNs6r2Wic7hq6nQK4azEKAsQM5jeH7EPQ 6tI9WzAt61323M8Q2J0gXUdZXvWCRgjWIkVlkiXafiIkhTtvnQ+Kgf2+Dy1quj/DfoBm UVkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:arc-authentication-results; bh=bNJTq6A/S9eMxvXUsIn6B4nibMyhqmhEa+4/ETGaYF8=; b=BT74wqCOa1YEbSndjCyAjB+SJyfFBZm3FkfKMaHRtOqftkWq+HmUFpTtTBub64BxzU 6SDTrvgvVBbBKaWmw1W4h3TbvMpg+eAnMLKdHdzAcZOsCd3II6WZWybWgR503pvTSihx 0wPcVpMrfB58mJhJDw+JwLaghkLOG6F+h16Q3jspKe1EQlijiElfGwIPAN+Z/1x58fiM RjjHVTE1D2MTa0YJpyZL2RFhE80cHaOhw2jQx6wJX4U5xHCP9bIQ0FGzSMrApGvAmfWx VRnT35Pbzn8FImcbGFmJriviVXGHry/Ug73bPJewyJ9sKVH5RjuSv14mPJ0+ccO2DoIt EyHg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i12si5308285pgr.256.2018.04.05.05.01.29; Thu, 05 Apr 2018 05:01:44 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751975AbeDEMAR (ORCPT + 99 others); Thu, 5 Apr 2018 08:00:17 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:48411 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751570AbeDEMAP (ORCPT ); Thu, 5 Apr 2018 08:00:15 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1f43Yr-0006ur-DD; Thu, 05 Apr 2018 12:00:13 +0000 From: Colin King To: William Breathitt Gray , Linus Walleij , linux-gpio@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] gpio: 104-dio-48e: make array 'ports' static, shrinks object size Date: Thu, 5 Apr 2018 13:00:12 +0100 Message-Id: <20180405120012.7671-1-colin.king@canonical.com> X-Mailer: git-send-email 2.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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