Received: by 10.223.185.111 with SMTP id b44csp13121wrg; Thu, 8 Mar 2018 23:48:40 -0800 (PST) X-Google-Smtp-Source: AG47ELt8rqJXp3WJjSrh+KZyHT/+N/V4HwMJwChgYC2RQ0R3QEEG9YCjYgnQf9zycbQ+vN2UeW+F X-Received: by 10.101.97.139 with SMTP id c11mr22995811pgv.439.1520581720476; Thu, 08 Mar 2018 23:48:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520581720; cv=none; d=google.com; s=arc-20160816; b=JRQXmrAcXpy7w40sra4JMsqVgK2TvrSrhtYOkzJEzyLJsi/L3qd9eYBOZgcriMY9V9 fSi2qf1ihucp+ervfJnckgcg/yIiUsT6rV8PphpwDu8bZKovV3tl23RiF5mfK9Vg4KbK dolv4ESYZvuermxE8LzdKTp/wbgwzUWvgZc3LB0uChdM1KjAKH+aK+THK9SVC8bcw9k9 5vGyP+jsFDFV3IUUE1MLA2z5pzYVT0ws68v/Btfir35Fpadkwk3Dp38gtCnOBDjR+nRj LsTeoIq99umApK1c7VlvHcD5oDMwJJYNlsqw0JK1zNhHVrGh/lb/vXylJc70n3Hd6b4x FhaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=Ptd2G3mBmJajccAZMV90pMEJZfkz6hD3QGXuGVW5XFY=; b=dZl3bqzsmhcMqAnPA3ircceEuYfITHy7lgAHUS3HAjX1uVlfwNxztDn6jae0UFepoY hL9AN7cPHNjvgZ8FinCYBrmg/7zKaKVAuE4LWIv3lJLqg0SflhkJ3cWxdceQH2FtxQud D+m809ci7AvAKNH5LiCch2IiNcIOFASA68AV/QrTMv+fwS3gQYmD5ySAbg0Wu5XX2se8 4qj5PurS2OSHjYuLEjZs+ZwdhuwsY2K2Yceh8pw9Fyfw44fG+vdi2S2ufzCEZQl74OW+ wePlCrXo9t/I0DgPTpD6zcBCJnRynbuiyAB/z0tQstl1jJ7eeGc1rcGEn1pd87+XeUyK oU3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Xcsx0fTg; 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 x3-v6si426622plb.738.2018.03.08.23.48.25; Thu, 08 Mar 2018 23:48:40 -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=fail header.i=@gmail.com header.s=20161025 header.b=Xcsx0fTg; 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 S1751458AbeCIHrZ (ORCPT + 99 others); Fri, 9 Mar 2018 02:47:25 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:39408 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750913AbeCIHrX (ORCPT ); Fri, 9 Mar 2018 02:47:23 -0500 Received: by mail-wm0-f65.google.com with SMTP id i3so2159544wmi.4; Thu, 08 Mar 2018 23:47:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Ptd2G3mBmJajccAZMV90pMEJZfkz6hD3QGXuGVW5XFY=; b=Xcsx0fTg47Af2bTeFePYPMLuF+70KJUGuI9HcUZximR3ZuAZLgkVsdFPHR1Ga+ZL6U WLrlQbNicCA46Un6KUTxoaH5MGzVlOW8ERr0f50sFKvK2ooqIyfDiYvwwADz92XAm0FD DXd3UVJiED3k2vQFbmidNLVBka0hH/ANq3Xlfx1AQFuncQVVratMUdeACKnMb1tjtTkr PPPYT3M2VFX9RE9G+Y0w2u6KvISEJmt4c66LSdm9BPQAlNQSKR3YXUMLi4H4nTqwqaMA gi1KeUH5moIYoYjHJNdW7o081dDVJZ7z9MpHTB7CW/8RjdGnTWpf9u/Hf8reEkCKtNpe BlDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Ptd2G3mBmJajccAZMV90pMEJZfkz6hD3QGXuGVW5XFY=; b=hoXFwjC2dyje3+bYHtjmI1DFS0lr8JTvQrzp6gViZV9Mu9xLo366HNtGmq+WhRr9T0 gMN/Zt21VrD69blEujUD4QHnyJBZNMqcvzgh6HeRADinYMCVrvDEOl704RdrD1nVN76X 34wuwYYnnyWypBDD263O0it3VFJ1V3OrmA/PxmC1rO8Kcs5wtikbv+L7u7btvMzrA1hs ih1ryYGr54NjMq38eYvwGZkk5LoXv0VaK/X3RuHEZeJeqHMjWo96IGFQSNxdRNkhN/Ef GGuq+TEeMXTGgKqHF9GAtwKbMEhUMu4faasRcW55YbJOYRuMFHtC2tHCmqVQGm6A+wwQ 9aNw== X-Gm-Message-State: AElRT7FOC9rCgm2PtDkg2aNmXdNLCtJFaBG/lmcG0JUT6hRC10+R/Z41 nwlFHb4dNP1CGfWtT61IOSc= X-Received: by 10.28.8.9 with SMTP id 9mr1122567wmi.54.1520581642364; Thu, 08 Mar 2018 23:47:22 -0800 (PST) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id v23sm479239wmc.22.2018.03.08.23.47.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Mar 2018 23:47:21 -0800 (PST) Date: Fri, 9 Mar 2018 08:47:19 +0100 From: Ingo Molnar To: Ard Biesheuvel Cc: linux-efi@vger.kernel.org, Thomas Gleixner , Colin Ian King , linux-kernel@vger.kernel.org Subject: Re: [PATCH 12/12] efi: make const array 'apple' static Message-ID: <20180309074719.y33xe4bjkjsjsaa3@gmail.com> References: <20180308080020.22828-1-ard.biesheuvel@linaro.org> <20180308080020.22828-13-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180308080020.22828-13-ard.biesheuvel@linaro.org> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * 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 }; > efi_char16_t *fw_vendor = (efi_char16_t *)(unsigned long) > efi_table_attr(efi_system_table, fw_vendor, sys_table); As a general policy, please don't put 'static' variables into the local scope, use file scope instead - right before setup_quirks() would be fine. This makes it abundantly clear that it's not on the stack. Also, would it make sense to rename it to something more descriptive like "apple_unicode_str[]" or so? Plus an unicode string literal initializer would be pretty descriptive as well, instead of the weird looking character array, i.e. something like: static efi_char16_t const apple_unicode_str[] = u"Apple"; ... or so? Thanks, Ingo