lkml.org 
[lkml]   [2018]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH 12/12] efi: make const array 'apple' static
From
Date
On Fri, 2018-03-09 at 07:44 +0000, Ard Biesheuvel wrote:
> On 9 March 2018 at 07:43, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> > On 8 March 2018 at 11:05, Joe Perches <joe@perches.com> wrote:
> > > On Thu, 2018-03-08 at 08:00 +0000, Ard Biesheuvel wrote:
> > > > From: Colin Ian King <colin.king@canonical.com>
> > > >
> > > > 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 <colin.king@canonical.com>
> > > > Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > > > ---
> > > > 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?

It'd be more like the the style used
in the rest of the kernel.

\
 
 \ /
  Last update: 2018-03-09 10:37    [W:0.083 / U:1.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site