Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3241673ybp; Sun, 6 Oct 2019 07:43:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwIz0+Cm3gd1yck6cYduwJ+aGkTCiTp9aBaKv+zZF/A9SnxKVGBvX6Ko6VMVBHwXFeoWYUt X-Received: by 2002:a17:906:4a17:: with SMTP id w23mr11855056eju.324.1570373030877; Sun, 06 Oct 2019 07:43:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570373030; cv=none; d=google.com; s=arc-20160816; b=e4wKmILcYRnemCHOhZR/8JwBQlugfQuo1WgQz16PwjQjcLDkSKiwY4tkV037y7ZFu9 vCl2Hv6bp1zU0GcGeb4JmY7D6Pd5RPhj227tjXeOrjsGkEzYV0Jgsy9Jk6aWZMxzgkdU CntwpxJ4APTBZhFPJBuDn32PxNXTpFkFjlLLmrBAcZAHiQ+lltAxaC9sa5Hnlmratuc6 66UFE2KXlUQ8/cA6lcQz9YHHyrj0J6xqTYs1LWx//aHMHZqjaFDJHrkoACjM+qX6sFnx nq/lcqer/ivDGdKyBK3FgfjG6L+uk7Mzi/y6QKtZf0TnxHVikh2g+OnsJfhoF17AeISG g00g== 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; bh=HH9M29YflCa+9UAbdMpUiIRibKeVWOszHIMmJe3QuOE=; b=FqJ/GIaq9MekVeUQK5Y3K+S7s/4VrNcAXYsFETyF0FHLCvzIZCPWjKXImbUZAZnTgj 5DTM4bGM8GHV11RB2/8T4t0MBDglb2jKxhEwNcoxzhl+ECmniclo6VlKmDsya8+WcU5J 4RJUMXG3O5SsgA4aSzB0gYSZNGR87/rQPhOSsqx3ArTcEVPfMikWvevazmdv6tHkoAoc ahwHfHkDIQ2Z9Uj0GFFF3bUU/7qfGSze7sDkwXNbv4/+po5p7uM9tNJK/WdKxG4Exwr4 yfHGGzY1Z2YvfdY6vT+bWuEJm7/MFFVhj0/p8QugvJk5UjguiA8jlEqOJ/NdjcJtHOn9 wHcA== 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 y12si5689462ejp.103.2019.10.06.07.43.25; Sun, 06 Oct 2019 07:43:50 -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 S1726349AbfJFOm7 (ORCPT + 99 others); Sun, 6 Oct 2019 10:42:59 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:55315 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725905AbfJFOm7 (ORCPT ); Sun, 6 Oct 2019 10:42:59 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iH7kO-00035R-Th; Sun, 06 Oct 2019 14:42:56 +0000 From: Colin King To: William Breathitt Gray , Linus Walleij , Bartosz Golaszewski , linux-gpio@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] gpio: 104-idi-48e: make array register_offset static, makes object smaller Date: Sun, 6 Oct 2019 15:42:56 +0100 Message-Id: <20191006144256.23733-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.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 array register_offset on the stack but instead make it static. Makes the object code smaller by 63 bytes. Also add the int type specifier to clean up a checkpatch warning. Before: text data bss dec hex filename 9212 5712 1408 16332 3fcc drivers/gpio/gpio-104-idi-48.o After: text data bss dec hex filename 9085 5776 1408 16269 3f8d drivers/gpio/gpio-104-idi-48.o (gcc version 9.2.1, amd64) Signed-off-by: Colin Ian King --- drivers/gpio/gpio-104-idi-48.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-104-idi-48.c b/drivers/gpio/gpio-104-idi-48.c index ff53887bdaa8..c95c93ec0bd7 100644 --- a/drivers/gpio/gpio-104-idi-48.c +++ b/drivers/gpio/gpio-104-idi-48.c @@ -65,7 +65,7 @@ static int idi_48_gpio_get(struct gpio_chip *chip, unsigned offset) { struct idi_48_gpio *const idi48gpio = gpiochip_get_data(chip); unsigned i; - const unsigned register_offset[6] = { 0, 1, 2, 4, 5, 6 }; + static const unsigned int register_offset[6] = { 0, 1, 2, 4, 5, 6 }; unsigned base_offset; unsigned mask; -- 2.20.1