From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89B2AC4741F for ; Thu, 5 Nov 2020 14:54:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 36B8620719 for ; Thu, 5 Nov 2020 14:54:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731437AbgKEOyX (ORCPT ); Thu, 5 Nov 2020 09:54:23 -0500 Received: from foss.arm.com ([217.140.110.172]:34882 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730465AbgKEOyX (ORCPT ); Thu, 5 Nov 2020 09:54:23 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D7C8B14BF; Thu, 5 Nov 2020 06:54:22 -0800 (PST) Received: from [10.57.54.223] (unknown [10.57.54.223]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AFD583F718; Thu, 5 Nov 2020 06:54:21 -0800 (PST) Subject: Re: [PATCH] pinctrl: Remove hole in pinctrl_gpio_range To: Linus Walleij , Geert Uytterhoeven Cc: "open list:GPIO SUBSYSTEM" , Heiko Stuebner , "linux-kernel@vger.kernel.org" , "open list:ARM/Rockchip SoC..." References: <20201028145117.1731876-1-geert+renesas@glider.be> From: Robin Murphy Message-ID: <77bc14cd-7e47-6972-ee0b-fa72bb9e9fad@arm.com> Date: Thu, 5 Nov 2020 14:54:21 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-11-05 13:57, Linus Walleij wrote: > On Wed, Oct 28, 2020 at 3:51 PM Geert Uytterhoeven > wrote: > >> On 64-bit platforms, pointer size and alignment are 64-bit, hence two >> 4-byte holes are present before the pins and gc members of the >> pinctrl_gpio_range structure. Get rid of these holes by moving the >> pins pointer. >> >> This reduces kernel size of an arm64 Rockchip kernel by ca. 512 bytes. >> >> Signed-off-by: Geert Uytterhoeven >> --- >> Compile-tested only (arm/multi_v7_defconfig and arm64/defconfig). > > Patch applied. > > Do you think it'd be worth it to add a check to checkpatch to suggest > to move pointers toward the end of any struct? For a general rule, I thought that ordering struct members largest-first was the conventional wisdom, since that way no sensible compiler would add padding between any members, only at the end? That said, the trouble with any checkpatch rule is that people will inevitably try to apply it indiscriminately. With structure layout, that could often end up hurting readability and/or performance (via cache effects), while in many cases making no actual difference to the overall size anyway. Robin.