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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <563673c0-799d-e353-974c-91b1ab881a22@suse.de>
Date:   Wed, 3 May 2023 09:09:24 +0200
From:   Thomas Zimmermann <tzimmermann@...e.de>
To:     Sam Ravnborg <sam@...nborg.org>
Cc:     linux-arch@...r.kernel.org, linux-fbdev@...r.kernel.org,
        linux-ia64@...r.kernel.org, loongarch@...ts.linux.dev,
        arnd@...db.de, deller@....de, chenhuacai@...nel.org,
        javierm@...hat.com, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org,
        James.Bottomley@...senpartnership.com,
        linux-m68k@...ts.linux-m68k.org, geert@...ux-m68k.org,
        linux-parisc@...r.kernel.org, vgupta@...nel.org,
        sparclinux@...r.kernel.org, kernel@...0n.name,
        linux-snps-arc@...ts.infradead.org, davem@...emloft.net,
        linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v3 4/6] fbdev: Include <linux/io.h> via <asm/fb.h>

Hi

Am 02.05.23 um 21:54 schrieb Sam Ravnborg:
> Hi Thomas,
> 
> On Tue, May 02, 2023 at 03:02:21PM +0200, Thomas Zimmermann wrote:
>> Fbdev's main header file, <linux/fb.h>, includes <asm/io.h> to get
>> declarations for I/O helper functions. From these declarations, it
>> later defines framebuffer I/O helpers, such as fb_{read,write}[bwlq]()
>> or fb_memset().
>>
>> The framebuffer I/O helpers depend on the system architecture and
>> will therefore be moved into <asm/fb.h>. Prepare this change by first
>> adding an include statement for <linux/io.h> to <asm-generic/fb.h>.
>> Include <asm/fb.h> in all source files that use the framebuffer I/O
>> helpers, so that they still get the necessary I/O functions.
>>
> ...
>>
>> diff --git a/drivers/video/fbdev/arkfb.c b/drivers/video/fbdev/arkfb.c
>> index 60a96fdb5dd8..fd38e8a073b8 100644
>> --- a/drivers/video/fbdev/arkfb.c
>> +++ b/drivers/video/fbdev/arkfb.c
>> @@ -27,6 +27,8 @@
>>   #include <linux/console.h> /* Why should fb driver call console functions? because console_lock() */
>>   #include <video/vga.h>
>>   
>> +#include <asm/fb.h>
> 
> When we have a header like linux/fb.h - it is my understanding that it is
> preferred to include that file, and not the asm/fb.h variant.
> 
> This is assuming the linux/fb.h contains the generic stuff, and includes
> asm/fb.h for the architecture specific parts.
> 
> So drivers will include linux/fb.h and then they automatically get the
> architecture specific parts from asm/fb.h.
> 
> In other words, drivers are not supposed to include asm/fb.h, if
> linux.fb.h exists - and linux/fb.h shall include the asm/fb.h.
> 
> If the above holds true, then it is wrong and not needed to add asm/fb.h
> as seen above.
> 
> 
> There are countless examples where the above are not followed,
> but to my best understanding the above it the preferred way to do it.

Where did youher this? I only know about this in the case of asm/io.h 
vs. linux/io.h.

If that's the case, we should put those helpers into a new header file, 
because one of the motivations here is to remove <asm/io.h> from 
<linux/fb.h>.

Best regards
Thomas

> 
> 	Sam

-- 
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