lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 4 Sep 2023 09:08:31 +0200
From:   Thomas Zimmermann <tzimmermann@...e.de>
To:     Helge Deller <deller@....de>, daniel@...ll.ch, javierm@...hat.com,
        sam@...nborg.org, linux-fbdev@...r.kernel.org,
        dri-devel@...ts.freedesktop.org
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/7] fbdev/core: Build fb_logo iff CONFIG_LOGO has been
 selected

Hi

Am 01.09.23 um 10:22 schrieb Helge Deller:
> On 8/29/23 16:15, Thomas Zimmermann wrote:
>> Only build fb_logo.c if CONFIG_LOGO has been selected. Otherwise
>> provide empty implementations of the contained interfaces and avoid
>> using the exported variables.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@...e.de>
> ...
>> diff --git a/drivers/video/fbdev/core/fbcon.c 
>> b/drivers/video/fbdev/core/fbcon.c
>> index f157a5a1dffc..24b038510a71 100644
>> --- a/drivers/video/fbdev/core/fbcon.c
>> +++ b/drivers/video/fbdev/core/fbcon.c
>> @@ -474,15 +474,19 @@ static int __init fb_console_setup(char *this_opt)
>>
>>           if (!strncmp(options, "logo-pos:", 9)) {
>>               options += 9;
>> +#ifdef CONFIG_LOGO
>>               if (!strcmp(options, "center"))
>>                   fb_center_logo = true;
>> +#endif
> 
> IMHO, *sometimes* it makes sense to not use #ifdef and code it instead 
> like this:
>                if (IS_ENABLED(CONFIG_LOGO) &&
>                  !strcmp(options, "center"))
> ...
> That way the compiler will optimize that code away as well, but in
> addition it will compile-check that you have correct coding independend
> if CONFIG_LOGO is set or not.

Good idea. I'll change it. The IS_ENABLED code is also easier to read IMHO.

Best regards
Thomas

> 
>>               continue;
>>           }
>>
>>           if (!strncmp(options, "logo-count:", 11)) {
>>               options += 11;
>> +#ifdef CONFIG_LOGO
>>               if (*options)
>>                   fb_logo_count = simple_strtol(options, &options, 0);
>> +#endif
> 
> same here.
> 
> Helge

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)

Download attachment "OpenPGP_signature" of type "application/pgp-signature" (841 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ