Received: by 10.223.185.111 with SMTP id b44csp11100wrg; Thu, 8 Mar 2018 23:45:45 -0800 (PST) X-Google-Smtp-Source: AG47ELvWgEQKeqEStperXCMoE4EGsV5/RiAdMZs6AaAOC51SxUhocOqgF8Iwz32a2lPfYr7tFW8h X-Received: by 2002:a17:902:c6b:: with SMTP id 98-v6mr26053856pls.267.1520581544917; Thu, 08 Mar 2018 23:45:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520581544; cv=none; d=google.com; s=arc-20160816; b=F1TTYMm/YAE+WOwrE8MmHcsh6QJld6J1MvTnjXibiMYjozzkoZC6g/WhZ3EmDRsF4K lDmG0FWcP4seEX9bHPon5mPuBXjYc6Hx6o/SR7kKgE/iYpDv4eZGMjci7ScJ/lbpRrpG u80kV9D3Mv6PN88LWHBJXm4ZAhTmiEmCeUKFM6/D1MpCDIhUWDe9/uaghj8g6rZ2Z8bv Oq/aqnafdGmMe7m+fTK3jvBS0OZzhoJW/Yds15Nkf/k78VZZNnZufD/753HZKWXxcjNA gz4zHYfippF2F8ZOuwtGEtF4LpMy+EufA/Arl1UQcVrnyxPh35KhT/i1I/NtQtIbd+NN di5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=Ju1NXmdiVs/JlsO6wt6+0tCu2QoZcJt1eTYkJWxXO1U=; b=bBwJOX7EItkEt7jvkd2ym1ZvZyNxjKyRH4LTRqS3XggoYLiDnrbSFTPM6DaNl0kgtC jKckgaM/IMlBOJ/E4Uer7nKt9e0wrgfXjzKZ45gKJNfpzE8lz4ZxAJFiAHyMtaZI98Dy MmlMrHt7L1vJVpnpyKWRp2X2ogzNulYpT9bLruZBOKUKuymO0mzBBTuz7xpVZk842F8N G9OGtvY6SwyARNgXwdmStJPl8EgULDMimh3MH4MYpuGqiDLlmWlXwLP+8ggS/87e7IYa tznrQPPZbA5hZvTVjb9qaZdslTQVGTwJ3EivDscNc9I7EjZCN79T+faqzq3fjiVAbNVO Hlgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UcC7cKai; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s4si370453pgf.390.2018.03.08.23.45.30; Thu, 08 Mar 2018 23:45:44 -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; dkim=pass header.i=@linaro.org header.s=google header.b=UcC7cKai; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751313AbeCIHoV (ORCPT + 99 others); Fri, 9 Mar 2018 02:44:21 -0500 Received: from mail-it0-f68.google.com ([209.85.214.68]:55420 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750848AbeCIHoT (ORCPT ); Fri, 9 Mar 2018 02:44:19 -0500 Received: by mail-it0-f68.google.com with SMTP id n136so1720391itg.5 for ; Thu, 08 Mar 2018 23:44:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Ju1NXmdiVs/JlsO6wt6+0tCu2QoZcJt1eTYkJWxXO1U=; b=UcC7cKaiuTtx9kZYKfgyBeRvAGn1qt+PylQIMkHf6f4Hzy5lzymWfB8DU6rEoTMLtO 4ydOzB/5sJezIUIoNg5kBNYEhCFrO8UXztXn4Iw6E2BsSbe8a2WUcErh7D2k8xL0MLp4 LCY2zFcdGlKP6uhSxeSwmf9Rp8+cNHg40jRR4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Ju1NXmdiVs/JlsO6wt6+0tCu2QoZcJt1eTYkJWxXO1U=; b=BTLw2DTM2SCCV9MTbZI5th21/z2T2+Tm7Xs/HJ50MIPYWRMF5C5D3tui9QPPUOSuDO RaUPmLsLsCCqgrRQZbi8/v1DnatF19qW3vfkfQJhkya/jtr+48abbHHe+ATfugLYL6UX oJPRqtpSF+v4bjRM2n/KrOZg8RJ94l2Ky5GWlVX68t6+etIeYJn8dVj8GVgbMXVy1Rth JcwtEf1vYWTl2Wktz777D4f1ggwDBSPiN+zxVwIoynNdkvi8hC8MAe58WP2+JFrXn+nq hPNVRuscl5Kd/RkI3v14SIQxF9QlZ1djrTsaoOXrCmrRb/+OG3QXgRlpX0/D8XnbacNp 2yDQ== X-Gm-Message-State: AElRT7Fa1+5+VMRiU0p64M+r42dBFhA2QMor5KuVDqRMWKPnFaQk8cFh L0F1damWnB0ij4UctftcwOvnVQaaosB/Aq+Kv3qToA== X-Received: by 10.36.91.138 with SMTP id g132mr2252675itb.50.1520581458802; Thu, 08 Mar 2018 23:44:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.138.209 with HTTP; Thu, 8 Mar 2018 23:44:18 -0800 (PST) In-Reply-To: References: <20180308080020.22828-1-ard.biesheuvel@linaro.org> <20180308080020.22828-13-ard.biesheuvel@linaro.org> <1520507105.11634.5.camel@perches.com> From: Ard Biesheuvel Date: Fri, 9 Mar 2018 07:44:18 +0000 Message-ID: Subject: Re: [PATCH 12/12] efi: make const array 'apple' static To: Joe Perches Cc: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner , Colin Ian King , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9 March 2018 at 07:43, Ard Biesheuvel wrote: > On 8 March 2018 at 11:05, Joe Perches wrote: >> On Thu, 2018-03-08 at 08:00 +0000, Ard Biesheuvel wrote: >>> From: Colin Ian King >>> >>> Don't populate the const read-only array 'buf' on the stack but instead >>> make it static. Makes the object code smaller by 64 bytes: >>> >>> Before: >>> text data bss dec hex filename >>> 9264 1 16 9281 2441 arch/x86/boot/compressed/eboot.o >>> >>> After: >>> text data bss dec hex filename >>> 9200 1 16 9217 2401 arch/x86/boot/compressed/eboot.o >>> >>> (gcc version 7.2.0 x86_64) >>> >>> Signed-off-by: Colin Ian King >>> Signed-off-by: Ard Biesheuvel >>> --- >>> arch/x86/boot/compressed/eboot.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c >>> index 886a9115af62..f2251c1c9853 100644 >>> --- a/arch/x86/boot/compressed/eboot.c >>> +++ b/arch/x86/boot/compressed/eboot.c >>> @@ -423,7 +423,7 @@ static void retrieve_apple_device_properties(struct boot_params *boot_params) >>> >>> static void setup_quirks(struct boot_params *boot_params) >>> { >>> - efi_char16_t const apple[] = { 'A', 'p', 'p', 'l', 'e', 0 }; >>> + static efi_char16_t const apple[] = { 'A', 'p', 'p', 'l', 'e', 0 }; >> >> Perhaps >> >> static const efi_char16_t apple[] ... >> >> is better. >> > > Why would that be any better? I have always found the 'const' > placement after the type to be much clearer. > > const void * > void const * > void * const > > I.e., #2 and #3 are equivalent, That would be #1 and #2, of course > and so 'const' associates to the left > not to the right, unless it is at the beginning. > > Personally, I don't mind either way, but saying it is 'better' is a stretch imo