Re: [PATCH 06/12] arch: Declare screen_info in <asm/screen_info.h>

Thomas Zimmermann <[email protected]>
Newsgroups gmane.linux.ports.sh.devel,gmane.linux.kernel,gmane.linux.ports.alpha,gmane.linux.ports.arm.kernel,gmane.linux.kernel.efi,gmane.linux.ports.hexagon,gmane.linux.ports.ia64,gmane.linux.ports.mips,gmane.linux.ports.ppc64.devel,gmane.linux.ports.riscv,gmane.linux.ports.sparc,gmane.comp.video.dri.devel,gmane.linux.kernel.cross-arch
Message-ID <[email protected]>
Hi

Am 29.06.23 um 15:03 schrieb Arnd Bergmann:
> On Thu, Jun 29, 2023, at 13:45, Thomas Zimmermann wrote:
> 
>> diff --git a/include/asm-generic/screen_info.h
>> b/include/asm-generic/screen_info.h
>> new file mode 100644
>> index 0000000000000..6fd0e50fabfcd
>> --- /dev/null
>> +++ b/include/asm-generic/screen_info.h
>> @@ -0,0 +1,12 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +
>> +#ifndef _ASM_GENERIC_SCREEN_INFO_H
>> +#define _ASM_GENERIC_SCREEN_INFO_H
>> +
>> +#include <uapi/linux/screen_info.h>
>> +
>> +#if defined(CONFIG_ARCH_HAS_SCREEN_INFO)
>> +extern struct screen_info screen_info;
>> +#endif
>> +
>> +#endif /* _ASM_GENERIC_SCREEN_INFO_H */
>> diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h
>> index eab7081392d50..c764b9a51c24b 100644
>> --- a/include/linux/screen_info.h
>> +++ b/include/linux/screen_info.h
>> @@ -4,6 +4,6 @@
>>
>>   #include <uapi/linux/screen_info.h>
>>
>> -extern struct screen_info screen_info;
>> +#include <asm/screen_info.h>
>>
> 
> What is the purpose of adding a file in asm-generic? If all
> architectures use the same generic file, I'd just leave the
> declaration in include/linux/. I wouldn't bother adding the

That appears a bit 'un-clean' for something that is defined in 
architecture? But OK, I would not object.

> #ifdef either, but I can see how that helps turn a link
> error into an earlier compile error.

Yes, that's intentional. If there's a Kconfig token anyway, we can also 
fail early during the build.

Best regards
Thomas

> 
>        Arnd

-- 
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)
OpenPGP_signature (application/pgp-signature, 840 B) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.