Received: by 10.223.185.111 with SMTP id b44csp10543wrg; Thu, 8 Mar 2018 23:44:46 -0800 (PST) X-Google-Smtp-Source: AG47ELsoAB79zaZzAnQN0/0v1QNuNrefrqCa8LMpOVqwXxcYrUK1QukFBO6mM2CpLiEoZOhMiuYJ X-Received: by 10.99.44.22 with SMTP id s22mr23630654pgs.111.1520581486548; Thu, 08 Mar 2018 23:44:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520581486; cv=none; d=google.com; s=arc-20160816; b=wSxSGA4GcIklJ0/78F9WcOg2Wljq4XjhZTvjYePTNmcOE1a1LOVRH9WVcmDnLgTpbJ clfkw+FSLn7vioAQmVx8phw1SXwN+E8sJvHyZc+SQZRORxq/EtwLXpFg3Jtj70rOoPuD Hh45WZQaA+uiMEhgCzPdDL6hHfIyxV25OHjrZ/fpufhTBnJiSPOY360yMJTh0zZM4vzi Me++5Bmw0az6bQ+dg1Mocnp2hnMMRh7tMTLr1V5e3wYEsWbIoUrFWOGCoD+SpLeb4W3C dAmS0BD/t7b1E9gRTKS76hH9lQRXhyMHuKjao8Sqeud31gjz8SA0lNu+oPSNqonAoNkT yifg== 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=brwpqrCze6lMKdKw8ZvVgq0A88jx7rNluJAugfYKUMU=; b=fs7aE30KC/25ZI9mZ8AKTveZvNg+nHiN0ahWHviwn3iNrcFU9fxmWXA7sbkIo/ahYQ 84Fto+gYOUjxnHYR5MFtp6rJdyLNykIK8qqq/yGq1gIWxr7cfly+wUl6ZUl6N5nf3S7S wYL1nOjhLspbJdELz0uGJNQMkG5E1UX3lwXXf3LYMerkQ11YYSNwUMnkvMtt13sCOVGA 4t4pLLpmQgNE4wWAXtulLJdxVWVQOcHY7v/1G+VLNIvOGceh80Ust9VQDT3/nzxqxEMY h91qDJrJN3hCNtmPIF5Bl7wpm8x/vaqM1KwQsTvb6C4FINSgEgBgr9iMB5BL9tK/2W62 Otfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CkSvNrUB; 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 e6si345529pgt.680.2018.03.08.23.44.31; Thu, 08 Mar 2018 23:44:46 -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=CkSvNrUB; 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 S1751267AbeCIHnl (ORCPT + 99 others); Fri, 9 Mar 2018 02:43:41 -0500 Received: from mail-io0-f196.google.com ([209.85.223.196]:44295 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750897AbeCIHnj (ORCPT ); Fri, 9 Mar 2018 02:43:39 -0500 Received: by mail-io0-f196.google.com with SMTP id h23so2579713iob.11 for ; Thu, 08 Mar 2018 23:43:39 -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=brwpqrCze6lMKdKw8ZvVgq0A88jx7rNluJAugfYKUMU=; b=CkSvNrUBXc8sxpJmzY0Im8spthisS8dZryV1HKRHsLkC2u28DXKsGZ1uJNY+rYs/I1 6efwgIEufveDXxzxrpB7zHbZfMCjuteZLME4qQohS9a3c/9767LBh1GqUfU8PZgDRtMh Wnw36DjIBSvPw7uNH6Bu1uuyEC4lbWcPvs598= 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=brwpqrCze6lMKdKw8ZvVgq0A88jx7rNluJAugfYKUMU=; b=kN33oFFrmq1HTKSJIgZcfrvbwvGgO7xkBOi+SZ8E0ssxwcaaWqaa5gdlXL2A19YdLr kuJqLbZa1DV0b84P10zjqTDKVL2i7EFcxdxC9d4yY/pyp8iW10Cz6YgcT9IsWkSKHiRz shvTEPBub1BC+6m+wMRRyGfQKkBTC3c15PC/743rxy1jf7L7SW0tMHKqoVr1o9KQpZfN 027XwPlM3FQqOSgVaOzw6bFmiesJ5reBpbHYODtBdzhTkPMJtcaLVnjsaNZzMr7cXwNs 3wAQS6ndA93OZMGWhMIOXnXEAmyZsSe9GbUuXOC+uRI5+5oIUmO3HK7cnlCbAHKRe2TH srrw== X-Gm-Message-State: AElRT7EYX1dJY6GN4oQQkW6k7eOZTDKnviHPi3ZG9yC9m7A07Y4ORKMA 71/uFc6vIl3WZPgMn1uH1reiXwmt7ukgbcrW+sx/FA== X-Received: by 10.107.56.69 with SMTP id f66mr33014175ioa.170.1520581418537; Thu, 08 Mar 2018 23:43:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.138.209 with HTTP; Thu, 8 Mar 2018 23:43:37 -0800 (PST) In-Reply-To: <1520507105.11634.5.camel@perches.com> 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:43:37 +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 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, 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