* [PATCH v1 1/2] LoongArch: Add missing headers @ 2023-09-14 10:34 Andy Shevchenko 2023-09-14 10:34 ` [PATCH v1 2/2] LoongArch: Use _UL() and _ULL() Andy Shevchenko 2023-09-14 15:25 ` [PATCH v1 1/2] LoongArch: Add missing headers Huacai Chen 0 siblings, 2 replies; 11+ messages in thread From: Andy Shevchenko @ 2023-09-14 10:34 UTC (permalink / raw) To: Andy Shevchenko, loongarch, linux-kernel; +Cc: Huacai Chen, WANG Xuerui The header uses definitions from sizes.h, include it. For __iomem we need the compiler_types.h, include it. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- arch/loongarch/include/asm/addrspace.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/loongarch/include/asm/addrspace.h b/arch/loongarch/include/asm/addrspace.h index 5c9c03bdf915..eaf8ac098622 100644 --- a/arch/loongarch/include/asm/addrspace.h +++ b/arch/loongarch/include/asm/addrspace.h @@ -10,7 +10,9 @@ #ifndef _ASM_ADDRSPACE_H #define _ASM_ADDRSPACE_H +#include <linux/compiler_types.h> #include <linux/const.h> +#include <linux/sizes.h> #include <asm/loongarch.h> -- 2.40.0.1.gaa8946217a0b ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v1 2/2] LoongArch: Use _UL() and _ULL() 2023-09-14 10:34 [PATCH v1 1/2] LoongArch: Add missing headers Andy Shevchenko @ 2023-09-14 10:34 ` Andy Shevchenko 2023-09-14 15:25 ` [PATCH v1 1/2] LoongArch: Add missing headers Huacai Chen 1 sibling, 0 replies; 11+ messages in thread From: Andy Shevchenko @ 2023-09-14 10:34 UTC (permalink / raw) To: Andy Shevchenko, loongarch, linux-kernel; +Cc: Huacai Chen, WANG Xuerui Use _UL() and _ULL() that are provided by const.h. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- arch/loongarch/include/asm/addrspace.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/loongarch/include/asm/addrspace.h b/arch/loongarch/include/asm/addrspace.h index eaf8ac098622..818077f62db8 100644 --- a/arch/loongarch/include/asm/addrspace.h +++ b/arch/loongarch/include/asm/addrspace.h @@ -21,7 +21,7 @@ */ #ifndef __ASSEMBLY__ #ifndef PHYS_OFFSET -#define PHYS_OFFSET _AC(0, UL) +#define PHYS_OFFSET _UL(0) #endif extern unsigned long vm_map_base; #endif /* __ASSEMBLY__ */ @@ -45,7 +45,7 @@ extern unsigned long vm_map_base; * Memory above this physical address will be considered highmem. */ #ifndef HIGHMEM_START -#define HIGHMEM_START (_AC(1, UL) << _AC(DMW_PABITS, UL)) +#define HIGHMEM_START (_UL(1) << _UL(DMW_PABITS)) #endif #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) @@ -67,16 +67,16 @@ extern unsigned long vm_map_base; #define _ATYPE_ #define _ATYPE32_ #define _ATYPE64_ -#define _CONST64_(x) x #else #define _ATYPE_ __PTRDIFF_TYPE__ #define _ATYPE32_ int #define _ATYPE64_ __s64 +#endif + #ifdef CONFIG_64BIT -#define _CONST64_(x) x ## UL +#define _CONST64_(x) _UL(x) #else -#define _CONST64_(x) x ## ULL -#endif +#define _CONST64_(x) _ULL(x) #endif /* -- 2.40.0.1.gaa8946217a0b ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v1 1/2] LoongArch: Add missing headers 2023-09-14 10:34 [PATCH v1 1/2] LoongArch: Add missing headers Andy Shevchenko 2023-09-14 10:34 ` [PATCH v1 2/2] LoongArch: Use _UL() and _ULL() Andy Shevchenko @ 2023-09-14 15:25 ` Huacai Chen 2023-09-14 18:52 ` Andy Shevchenko 1 sibling, 1 reply; 11+ messages in thread From: Huacai Chen @ 2023-09-14 15:25 UTC (permalink / raw) To: Andy Shevchenko; +Cc: loongarch, linux-kernel, WANG Xuerui Hi, Andy, Thank you for your patch, can this patch solve the problem below? https://lore.kernel.org/oe-kbuild-all/202309072237.9zxMv4MZ-lkp@intel.com/T/#u If yes, please add a reference in the commit message. I have investigated this problem for a long time but failed to solve it. Huacai On Thu, Sep 14, 2023 at 6:34 PM Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > The header uses definitions from sizes.h, include it. > For __iomem we need the compiler_types.h, include it. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > --- > arch/loongarch/include/asm/addrspace.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/loongarch/include/asm/addrspace.h b/arch/loongarch/include/asm/addrspace.h > index 5c9c03bdf915..eaf8ac098622 100644 > --- a/arch/loongarch/include/asm/addrspace.h > +++ b/arch/loongarch/include/asm/addrspace.h > @@ -10,7 +10,9 @@ > #ifndef _ASM_ADDRSPACE_H > #define _ASM_ADDRSPACE_H > > +#include <linux/compiler_types.h> > #include <linux/const.h> > +#include <linux/sizes.h> > > #include <asm/loongarch.h> > > -- > 2.40.0.1.gaa8946217a0b > > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v1 1/2] LoongArch: Add missing headers 2023-09-14 15:25 ` [PATCH v1 1/2] LoongArch: Add missing headers Huacai Chen @ 2023-09-14 18:52 ` Andy Shevchenko 2023-09-15 0:36 ` Huacai Chen 0 siblings, 1 reply; 11+ messages in thread From: Andy Shevchenko @ 2023-09-14 18:52 UTC (permalink / raw) To: Huacai Chen; +Cc: loongarch, linux-kernel, WANG Xuerui On Thu, Sep 14, 2023 at 11:25:22PM +0800, Huacai Chen wrote: > Hi, Andy, > > Thank you for your patch, can this patch solve the problem below? > https://lore.kernel.org/oe-kbuild-all/202309072237.9zxMv4MZ-lkp@intel.com/T/#u Nope, this just adds missing includes. No functional change, so warnings will still be there. > If yes, please add a reference in the commit message. I have > investigated this problem for a long time but failed to solve it. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v1 1/2] LoongArch: Add missing headers 2023-09-14 18:52 ` Andy Shevchenko @ 2023-09-15 0:36 ` Huacai Chen 2023-09-16 10:24 ` Andy Shevchenko 0 siblings, 1 reply; 11+ messages in thread From: Huacai Chen @ 2023-09-15 0:36 UTC (permalink / raw) To: Andy Shevchenko; +Cc: loongarch, linux-kernel, WANG Xuerui Hi, Andy, On Fri, Sep 15, 2023 at 2:53 AM Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > On Thu, Sep 14, 2023 at 11:25:22PM +0800, Huacai Chen wrote: > > Hi, Andy, > > > > Thank you for your patch, can this patch solve the problem below? > > https://lore.kernel.org/oe-kbuild-all/202309072237.9zxMv4MZ-lkp@intel.com/T/#u > > Nope, this just adds missing includes. > No functional change, so warnings will still be there. But I think a patch should solve a problem. If we don't get a build error or warning without this patch, does that mean the 'missing' headers are actually included indirectly? Huacai > > > If yes, please add a reference in the commit message. I have > > investigated this problem for a long time but failed to solve it. > > -- > With Best Regards, > Andy Shevchenko > > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v1 1/2] LoongArch: Add missing headers 2023-09-15 0:36 ` Huacai Chen @ 2023-09-16 10:24 ` Andy Shevchenko 2023-09-16 12:05 ` Huacai Chen 0 siblings, 1 reply; 11+ messages in thread From: Andy Shevchenko @ 2023-09-16 10:24 UTC (permalink / raw) To: Huacai Chen; +Cc: loongarch, linux-kernel, WANG Xuerui On Fri, Sep 15, 2023 at 08:36:24AM +0800, Huacai Chen wrote: > On Fri, Sep 15, 2023 at 2:53 AM Andy Shevchenko > <andriy.shevchenko@linux.intel.com> wrote: > > On Thu, Sep 14, 2023 at 11:25:22PM +0800, Huacai Chen wrote: > > > Thank you for your patch, can this patch solve the problem below? > > > https://lore.kernel.org/oe-kbuild-all/202309072237.9zxMv4MZ-lkp@intel.com/T/#u > > > > Nope, this just adds missing includes. > > No functional change, so warnings will still be there. > But I think a patch should solve a problem. No, that problem is static analyser concern, not the compiler nor linker. > If we don't get a build > error or warning without this patch, does that mean the 'missing' > headers are actually included indirectly? I might be missing something, but I do not see any build error in the above message. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v1 1/2] LoongArch: Add missing headers 2023-09-16 10:24 ` Andy Shevchenko @ 2023-09-16 12:05 ` Huacai Chen 2023-09-18 6:49 ` Andy Shevchenko 0 siblings, 1 reply; 11+ messages in thread From: Huacai Chen @ 2023-09-16 12:05 UTC (permalink / raw) To: Andy Shevchenko; +Cc: loongarch, linux-kernel, WANG Xuerui On Sat, Sep 16, 2023 at 6:27 PM Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > On Fri, Sep 15, 2023 at 08:36:24AM +0800, Huacai Chen wrote: > > On Fri, Sep 15, 2023 at 2:53 AM Andy Shevchenko > > <andriy.shevchenko@linux.intel.com> wrote: > > > On Thu, Sep 14, 2023 at 11:25:22PM +0800, Huacai Chen wrote: > > > > > Thank you for your patch, can this patch solve the problem below? > > > > https://lore.kernel.org/oe-kbuild-all/202309072237.9zxMv4MZ-lkp@intel.com/T/#u > > > > > > Nope, this just adds missing includes. > > > No functional change, so warnings will still be there. > > But I think a patch should solve a problem. > > No, that problem is static analyser concern, not the compiler nor linker. > > > If we don't get a build > > error or warning without this patch, does that mean the 'missing' > > headers are actually included indirectly? > > I might be missing something, but I do not see any build error in the above message. Hmm, then I think I will take the second patch only. Huacai > > -- > With Best Regards, > Andy Shevchenko > > > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v1 1/2] LoongArch: Add missing headers 2023-09-16 12:05 ` Huacai Chen @ 2023-09-18 6:49 ` Andy Shevchenko 2023-09-18 8:05 ` Huacai Chen 0 siblings, 1 reply; 11+ messages in thread From: Andy Shevchenko @ 2023-09-18 6:49 UTC (permalink / raw) To: Huacai Chen; +Cc: loongarch, linux-kernel, WANG Xuerui On Sat, Sep 16, 2023 at 08:05:52PM +0800, Huacai Chen wrote: > On Sat, Sep 16, 2023 at 6:27 PM Andy Shevchenko > <andriy.shevchenko@linux.intel.com> wrote: > > On Fri, Sep 15, 2023 at 08:36:24AM +0800, Huacai Chen wrote: > > > On Fri, Sep 15, 2023 at 2:53 AM Andy Shevchenko > > > <andriy.shevchenko@linux.intel.com> wrote: > > > > On Thu, Sep 14, 2023 at 11:25:22PM +0800, Huacai Chen wrote: > > > > > > > Thank you for your patch, can this patch solve the problem below? > > > > > https://lore.kernel.org/oe-kbuild-all/202309072237.9zxMv4MZ-lkp@intel.com/T/#u > > > > > > > > Nope, this just adds missing includes. > > > > No functional change, so warnings will still be there. > > > But I think a patch should solve a problem. > > > > No, that problem is static analyser concern, not the compiler nor linker. > > > > > If we don't get a build > > > error or warning without this patch, does that mean the 'missing' > > > headers are actually included indirectly? > > > > I might be missing something, but I do not see any build error in the above message. > Hmm, then I think I will take the second patch only. Thanks, but can you shed a light why? The rule of thumb is to include the headers we are direct users of, we have not to imply any other inclusions done by others, unless it's kinda same family of headers (like types.h always includes compiler_types.h). Since in your case the const.h is included the other two are missing and it's even worse, as I understand you rely on the specific headers to be included _before_ using this one in the users. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v1 1/2] LoongArch: Add missing headers 2023-09-18 6:49 ` Andy Shevchenko @ 2023-09-18 8:05 ` Huacai Chen 2023-09-18 8:23 ` Andy Shevchenko 0 siblings, 1 reply; 11+ messages in thread From: Huacai Chen @ 2023-09-18 8:05 UTC (permalink / raw) To: Andy Shevchenko; +Cc: loongarch, linux-kernel, WANG Xuerui Hi, Andy, On Mon, Sep 18, 2023 at 2:49 PM Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > On Sat, Sep 16, 2023 at 08:05:52PM +0800, Huacai Chen wrote: > > On Sat, Sep 16, 2023 at 6:27 PM Andy Shevchenko > > <andriy.shevchenko@linux.intel.com> wrote: > > > On Fri, Sep 15, 2023 at 08:36:24AM +0800, Huacai Chen wrote: > > > > On Fri, Sep 15, 2023 at 2:53 AM Andy Shevchenko > > > > <andriy.shevchenko@linux.intel.com> wrote: > > > > > On Thu, Sep 14, 2023 at 11:25:22PM +0800, Huacai Chen wrote: > > > > > > > > > Thank you for your patch, can this patch solve the problem below? > > > > > > https://lore.kernel.org/oe-kbuild-all/202309072237.9zxMv4MZ-lkp@intel.com/T/#u > > > > > > > > > > Nope, this just adds missing includes. > > > > > No functional change, so warnings will still be there. > > > > But I think a patch should solve a problem. > > > > > > No, that problem is static analyser concern, not the compiler nor linker. > > > > > > > If we don't get a build > > > > error or warning without this patch, does that mean the 'missing' > > > > headers are actually included indirectly? > > > > > > I might be missing something, but I do not see any build error in the above message. > > Hmm, then I think I will take the second patch only. > > Thanks, but can you shed a light why? > > The rule of thumb is to include the headers we are direct users of, we have not > to imply any other inclusions done by others, unless it's kinda same family of > headers (like types.h always includes compiler_types.h). Since in your case > the const.h is included the other two are missing and it's even worse, as I > understand you rely on the specific headers to be included _before_ using this > one in the users. I agree with you more or less, but I doubt there is another rule: no break, no fix. Please see: https://lore.kernel.org/loongarch/20221024070105.306280-1-chenhuacai@loongson.cn/T/#t Obviously static_key is used in page-flags.h and it really causes build errors once before, but at last I removed the inclusion of static_key.h to get that series merged. Huacai > > > -- > With Best Regards, > Andy Shevchenko > > > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v1 1/2] LoongArch: Add missing headers 2023-09-18 8:05 ` Huacai Chen @ 2023-09-18 8:23 ` Andy Shevchenko 2023-09-19 0:56 ` Guo Ren 0 siblings, 1 reply; 11+ messages in thread From: Andy Shevchenko @ 2023-09-18 8:23 UTC (permalink / raw) To: Huacai Chen, Guo Ren; +Cc: loongarch, linux-kernel, WANG Xuerui On Mon, Sep 18, 2023 at 04:05:50PM +0800, Huacai Chen wrote: > On Mon, Sep 18, 2023 at 2:49 PM Andy Shevchenko > <andriy.shevchenko@linux.intel.com> wrote: > > On Sat, Sep 16, 2023 at 08:05:52PM +0800, Huacai Chen wrote: > > > On Sat, Sep 16, 2023 at 6:27 PM Andy Shevchenko > > > <andriy.shevchenko@linux.intel.com> wrote: > > > > On Fri, Sep 15, 2023 at 08:36:24AM +0800, Huacai Chen wrote: > > > > > On Fri, Sep 15, 2023 at 2:53 AM Andy Shevchenko > > > > > <andriy.shevchenko@linux.intel.com> wrote: > > > > > > On Thu, Sep 14, 2023 at 11:25:22PM +0800, Huacai Chen wrote: > > > > > > > > > > > Thank you for your patch, can this patch solve the problem below? > > > > > > > https://lore.kernel.org/oe-kbuild-all/202309072237.9zxMv4MZ-lkp@intel.com/T/#u > > > > > > > > > > > > Nope, this just adds missing includes. > > > > > > No functional change, so warnings will still be there. > > > > > But I think a patch should solve a problem. > > > > > > > > No, that problem is static analyser concern, not the compiler nor linker. > > > > > > > > > If we don't get a build > > > > > error or warning without this patch, does that mean the 'missing' > > > > > headers are actually included indirectly? > > > > > > > > I might be missing something, but I do not see any build error in the above message. > > > Hmm, then I think I will take the second patch only. > > > > Thanks, but can you shed a light why? > > > > The rule of thumb is to include the headers we are direct users of, we have not > > to imply any other inclusions done by others, unless it's kinda same family of > > headers (like types.h always includes compiler_types.h). Since in your case > > the const.h is included the other two are missing and it's even worse, as I > > understand you rely on the specific headers to be included _before_ using this > > one in the users. > I agree with you more or less, but I doubt there is another rule: no > break, no fix. Please see: > > https://lore.kernel.org/loongarch/20221024070105.306280-1-chenhuacai@loongson.cn/T/#t > > Obviously static_key is used in page-flags.h and it really causes > build errors once before, but at last I removed the inclusion of > static_key.h to get that series merged. This is strange requirement to be honest. Doing like this is to move your responsibility and understanding of the code to be a burden of the person who volunteers cleaning up the header mess we have in the Linux kernel source tree. Since I'm the one who tries to fix some mess (in particular kernel.h), I am pretty much know what I am talking about from the experience. Cc'ing Guo. Guo, can you shed a light on the rationale of your comment in the above mentioned thread? -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v1 1/2] LoongArch: Add missing headers 2023-09-18 8:23 ` Andy Shevchenko @ 2023-09-19 0:56 ` Guo Ren 0 siblings, 0 replies; 11+ messages in thread From: Guo Ren @ 2023-09-19 0:56 UTC (permalink / raw) To: Andy Shevchenko; +Cc: Huacai Chen, loongarch, linux-kernel, WANG Xuerui On Mon, Sep 18, 2023 at 4:23 PM Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > On Mon, Sep 18, 2023 at 04:05:50PM +0800, Huacai Chen wrote: > > On Mon, Sep 18, 2023 at 2:49 PM Andy Shevchenko > > <andriy.shevchenko@linux.intel.com> wrote: > > > On Sat, Sep 16, 2023 at 08:05:52PM +0800, Huacai Chen wrote: > > > > On Sat, Sep 16, 2023 at 6:27 PM Andy Shevchenko > > > > <andriy.shevchenko@linux.intel.com> wrote: > > > > > On Fri, Sep 15, 2023 at 08:36:24AM +0800, Huacai Chen wrote: > > > > > > On Fri, Sep 15, 2023 at 2:53 AM Andy Shevchenko > > > > > > <andriy.shevchenko@linux.intel.com> wrote: > > > > > > > On Thu, Sep 14, 2023 at 11:25:22PM +0800, Huacai Chen wrote: > > > > > > > > > > > > > Thank you for your patch, can this patch solve the problem below? > > > > > > > > https://lore.kernel.org/oe-kbuild-all/202309072237.9zxMv4MZ-lkp@intel.com/T/#u > > > > > > > > > > > > > > Nope, this just adds missing includes. > > > > > > > No functional change, so warnings will still be there. > > > > > > But I think a patch should solve a problem. > > > > > > > > > > No, that problem is static analyser concern, not the compiler nor linker. > > > > > > > > > > > If we don't get a build > > > > > > error or warning without this patch, does that mean the 'missing' > > > > > > headers are actually included indirectly? > > > > > > > > > > I might be missing something, but I do not see any build error in the above message. > > > > Hmm, then I think I will take the second patch only. > > > > > > Thanks, but can you shed a light why? > > > > > > The rule of thumb is to include the headers we are direct users of, we have not > > > to imply any other inclusions done by others, unless it's kinda same family of > > > headers (like types.h always includes compiler_types.h). Since in your case > > > the const.h is included the other two are missing and it's even worse, as I > > > understand you rely on the specific headers to be included _before_ using this > > > one in the users. > > I agree with you more or less, but I doubt there is another rule: no > > break, no fix. Please see: > > > > https://lore.kernel.org/loongarch/20221024070105.306280-1-chenhuacai@loongson.cn/T/#t > > > > Obviously static_key is used in page-flags.h and it really causes > > build errors once before, but at last I removed the inclusion of > > static_key.h to get that series merged. > > This is strange requirement to be honest. Doing like this is to move your > responsibility and understanding of the code to be a burden of the person who > volunteers cleaning up the header mess we have in the Linux kernel source tree. > > Since I'm the one who tries to fix some mess (in particular kernel.h), I am > pretty much know what I am talking about from the experience. > > Cc'ing Guo. Guo, can you shed a light on the rationale of your comment in > the above mentioned thread? diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 5c02720c53a5..9cdef3944a75 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -9,6 +9,7 @@ #include <linux/types.h> #include <linux/bug.h> #include <linux/mmdebug.h> +#include <linux/static_key.h> #ifndef __GENERATING_BOUNDS_H #include <linux/mm_types.h> #include <generated/bounds.h> My meaning is riscv needn't include the above header file to support HVO, and I just tested the above modification with riscv, all passed, so go ahead. > > -- > With Best Regards, > Andy Shevchenko > > -- Best Regards Guo Ren ^ permalink raw reply related [flat|nested] 11+ messages in thread
end of thread, other threads:[~2023-09-19 0:58 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-09-14 10:34 [PATCH v1 1/2] LoongArch: Add missing headers Andy Shevchenko 2023-09-14 10:34 ` [PATCH v1 2/2] LoongArch: Use _UL() and _ULL() Andy Shevchenko 2023-09-14 15:25 ` [PATCH v1 1/2] LoongArch: Add missing headers Huacai Chen 2023-09-14 18:52 ` Andy Shevchenko 2023-09-15 0:36 ` Huacai Chen 2023-09-16 10:24 ` Andy Shevchenko 2023-09-16 12:05 ` Huacai Chen 2023-09-18 6:49 ` Andy Shevchenko 2023-09-18 8:05 ` Huacai Chen 2023-09-18 8:23 ` Andy Shevchenko 2023-09-19 0:56 ` Guo Ren
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox