Received: by 10.223.164.202 with SMTP id h10csp4097652wrb; Wed, 29 Nov 2017 00:31:47 -0800 (PST) X-Google-Smtp-Source: AGs4zMYJ2dohP/3igp6+NH/lq/MQi6YHuSVbwpOXnMZq/SGescU1SXt6frNXV2kqubNcHTfNN1fg X-Received: by 10.84.133.1 with SMTP id 1mr2092954plf.203.1511944307871; Wed, 29 Nov 2017 00:31:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511944307; cv=none; d=google.com; s=arc-20160816; b=mUHmtJuUti7ADoQuvk+F3i7eZrGIeXKH56pK0zrC0AkHKOBY48kVRRFf2xNHRqbOgo cHMJKcpJN38vLAuUOTnNMeHq1no+k1drY7BJ8aY3YzRg0LAFjbpEclMEgq9KEzW0Onc1 rOCJQReMoiiPJ0bW9Wb4nRhkewpUwlKMzseBtf14SqUETxk1EYQOEGZOTE8Mba2hooFq Tw/xL5PG7aLwnmKUwnI7f+V3HiQhSYmn7Ux5St01WhU8GHameT6itn5QLRz0N8CAe0kj sgwn6/MRUWjM2lqkUr1Gzh9wL1GB9L1zumw3+gNAaFK+x2bUBm1jp+8cwO/UNO7yjWkl e6uw== 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:in-reply-to :references:subject:cc:to:mime-version:user-agent:reply-to:from:date :message-id:arc-authentication-results; bh=bu2snzbEzvgDUoNhZyqrGqnuHMWqmW54jHsKtzv8K84=; b=YjsPXUG/2QbLxIZvnO9XyW6L5wf6uJzz28RUUp1Qms2FPWotTveIEjiEg1ZhytPvUE t7tpbKRJEsYJAqjsrJg8T8ib2aIXCB6cytSMZPh5OfR2p0jw2s4NypML8/iKu4ixucBs lBPJQ94qoVG06sRMWKHgOknXaWQdVUdC/VZqz3nBzKXLe4DjlrqBNP+kuJMlOD8nEyqA hGIT+yJZGeWQ9mkQnQ7cEut1qnxPA9fAMx4mBvfxvGLVa39ZVSZHsqnzd8btF85FwFKm 7jk5G9KJxPCJVtKp+IPbpwF+Ka+EtuCX8JyDqVe6ceP1tFM69P6s7Uf3SMLc9LO5mZQB xqgg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c1si956795pfd.416.2017.11.29.00.31.37; Wed, 29 Nov 2017 00:31:47 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752314AbdK2ITl (ORCPT + 71 others); Wed, 29 Nov 2017 03:19:41 -0500 Received: from mx02-sz.bfs.de ([194.94.69.103]:29257 "EHLO mx02-sz.bfs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751537AbdK2ITj (ORCPT ); Wed, 29 Nov 2017 03:19:39 -0500 Received: from localhost (localhost [127.0.0.1]) by mx02-sz.bfs.de (Postfix) with ESMTP id 6773F331; Wed, 29 Nov 2017 09:19:37 +0100 (CET) X-Virus-Scanned: amavisd-new at bfs.de Received: from mx02-sz.bfs.de ([127.0.0.1]) by localhost (mx02-sz.bfs.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Na8LsexEFemA; Wed, 29 Nov 2017 09:19:36 +0100 (CET) Received: from mail-fr.bfs.de (mail-fr.bfs.de [10.177.18.200]) by mx02-sz.bfs.de (Postfix) with ESMTPS; Wed, 29 Nov 2017 09:19:36 +0100 (CET) Received: from [134.92.181.33] (unknown [134.92.181.33]) by mail-fr.bfs.de (Postfix) with ESMTPS id 35C55BEE58; Wed, 29 Nov 2017 09:19:36 +0100 (CET) Message-ID: <5A1E6D97.1050109@bfs.de> Date: Wed, 29 Nov 2017 09:19:35 +0100 From: walter harms Reply-To: wharms@bfs.de User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.1.16) Gecko/20101125 SUSE/3.0.11 Thunderbird/3.0.11 MIME-Version: 1.0 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: gpio-stmpe: make various char arrays static const, shrinks object size References: <20171128182339.24579-1-colin.king@canonical.com> In-Reply-To: <20171128182339.24579-1-colin.king@canonical.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 28.11.2017 19:23, schrieb Colin King: > From: Colin Ian King > > Don't populate the read-only arrays edge_det_values, rise_values and > fall_values on the stack but instead make them static and constify them. > Makes the object code smaller by over 240 bytes: > > Before: > text data bss dec hex filename > 9525 2520 192 12237 2fcd drivers/gpio/gpio-stmpe.o > > After: > text data bss dec hex filename > 9025 2776 192 11993 2ed9 drivers/gpio/gpio-stmpe.o > > (gcc version 7.2.0 x86_64) > > Signed-off-by: Colin Ian King > --- > drivers/gpio/gpio-stmpe.c | 24 +++++++++++++++--------- > 1 file changed, 15 insertions(+), 9 deletions(-) > > diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c > index e6e5cca624a7..e3d048e65339 100644 > --- a/drivers/gpio/gpio-stmpe.c > +++ b/drivers/gpio/gpio-stmpe.c > @@ -273,15 +273,21 @@ static void stmpe_dbg_show_one(struct seq_file *s, > u8 fall_reg; > u8 irqen_reg; > > - char *edge_det_values[] = {"edge-inactive", > - "edge-asserted", > - "not-supported"}; > - char *rise_values[] = {"no-rising-edge-detection", > - "rising-edge-detection", > - "not-supported"}; > - char *fall_values[] = {"no-falling-edge-detection", > - "falling-edge-detection", > - "not-supported"}; > + static const char * const edge_det_values[] = { > + "edge-inactive", > + "edge-asserted", > + "not-supported" > + }; > + static const char * const rise_values[] = { > + "no-rising-edge-detection", > + "rising-edge-detection", > + "not-supported" > + }; > + static const char * const fall_values[] = { > + "no-falling-edge-detection", > + "falling-edge-detection", > + "not-supported" > + }; > #define NOT_SUPPORTED_IDX 2 @maintainer: the define here is hard to find, perhaps i should be move to a place where i can be found more easily. Like the beginning of line. re, wh > u8 edge_det = NOT_SUPPORTED_IDX; > u8 rise = NOT_SUPPORTED_IDX; From 1585335308354949366@xxx Tue Nov 28 18:26:06 +0000 2017 X-GM-THRID: 1585335308354949366 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread