Message ID | 20230914103445.511285-1-andriy.shevchenko@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp317554vqi; Thu, 14 Sep 2023 05:40:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE3ZvLkUjgfzlM+MCRmRUuebsQeoCG3UskP/bIEqcb0Bm9US/jzlAAa5ZWotScFSEWygrzG X-Received: by 2002:a25:fc0d:0:b0:d78:414d:1913 with SMTP id v13-20020a25fc0d000000b00d78414d1913mr5375864ybd.54.1694695254353; Thu, 14 Sep 2023 05:40:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694695254; cv=none; d=google.com; s=arc-20160816; b=UsGeXqOGD3GZAFZL1KyHPnyStj4l8/QQP1QdhN7MW91XKQ0qbPjisc3eMxVE+iQqZz xXWqE35uELhSPKIa9HcpAOGrMppBH/dWfd1e7ze9jP/fCHWonmVUbf3piRDeC8yWDT1i NZ9+D0/5hlEZHpl5sZJ0FWc9zx5YUxaNEZmcQqRRstcrsmo4knXQ3hQCJUulRVLKPorV zF4eZJUsa+RTZQ6R2KUt3R2GwzuTnfuJkkFjNvZ6vbmR5FuCHSvU/YLrx1tPvtfueFyF /oFmE1UHOyNkWVbE3E+SchAR4Go/CtCS+9TqCkJAUAW9UBmJTDjRfxx6+MRQaFA9Vdft m9Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=IS22Ui7D0rQm+BolwXjmYu4TDoHvNXtjGtWatxxCbWA=; fh=C4TS1uW9JqhSIjCGqUJXimN6TOA0T6Mn6u6DPCu+h9Y=; b=0uUC/2aFHDYsTLb7ny4zaBVMcagul1CX9KDmjNIMtjUpDUk+b4LvtVJ0QH/IAuoFTD 9c7ixGsI9kvZ2RNBpfEYBQJg9jetdahCSguyuHeiyRq/Oi5sr18sgcfUpt9HOHEHOjGk owo7Occ5y0Qk5XI6Wg8AqxiWSyio3T+pbP8bDFNNTp7UX/HZyWQBF7YHFijyAWux1yIj JESIOe/lBCFImoBVr/j5WGZsWh1ohCW+3fscrB1FNz1YN5wIiy7LUVDLwNi4f8H5QJkk fGpwIDBsCnY+8bbuUPWI7O5mihcITslMMIaQABOEr4i6gCjQSwIqlFBocnHaKsKLhDEv EoVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=djSkycFB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id bk13-20020a056a02028d00b005658a6b71cdsi1447981pgb.1.2023.09.14.05.40.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 05:40:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=djSkycFB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 840588029343; Thu, 14 Sep 2023 03:35:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237397AbjINKfA (ORCPT <rfc822;chrisfriedt@gmail.com> + 35 others); Thu, 14 Sep 2023 06:35:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237290AbjINKe4 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 14 Sep 2023 06:34:56 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 809B91BF0 for <linux-kernel@vger.kernel.org>; Thu, 14 Sep 2023 03:34:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694687692; x=1726223692; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=aN8wfY/EBvXBgqx7gt1Geu4H5jZOEEVWoImAqjfQ5So=; b=djSkycFBUje2xn2/OEBLqCNIfHPVHTDroabje0m6iHA32dkrfUmeevaX 2K/YJi+N7a5XDZVF7CXfr75Aq3jSo/HkpdEvieyRNHgxRArpXwwmxILzl ZN3exJqKh5X/GbAcOUkTYwO9wVvV1RvUZN+VWWEXPVw8tlqUj2Z99JSCJ /Qis0F39c7saHq8zHWURIcvK+59+nA+vFKWFLA2t8Q18JTQ9ZCK3IbsJb MVs4ZhcITeyLOG75K8zpDXQMbhgq5TiIjTYp2BjyfL3lWSd4DcihknUmX pTOl0DnDovCig7Qvx7yzTwDp6BNcDaXD1l1E+tPWMGe48Opr3A8KvFVn5 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10832"; a="409867724" X-IronPort-AV: E=Sophos;i="6.02,145,1688454000"; d="scan'208";a="409867724" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2023 03:34:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10832"; a="814625070" X-IronPort-AV: E=Sophos;i="6.02,145,1688454000"; d="scan'208";a="814625070" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 14 Sep 2023 03:34:50 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 205838C9; Thu, 14 Sep 2023 13:34:48 +0300 (EEST) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>, loongarch@lists.linux.dev, linux-kernel@vger.kernel.org Cc: Huacai Chen <chenhuacai@kernel.org>, WANG Xuerui <kernel@xen0n.name> Subject: [PATCH v1 1/2] LoongArch: Add missing headers Date: Thu, 14 Sep 2023 13:34:44 +0300 Message-Id: <20230914103445.511285-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 14 Sep 2023 03:35:08 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777016770897646812 X-GMAIL-MSGID: 1777016770897646812 |
Series |
[v1,1/2] LoongArch: Add missing headers
|
|
Commit Message
Andy Shevchenko
Sept. 14, 2023, 10:34 a.m. UTC
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(+)
Comments
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 > >
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.
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 > >
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.
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 > > >
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.
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 > > >
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?
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 > >
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>