public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Huacai Chen <chenhuacai@kernel.org>
Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org,
	WANG Xuerui <kernel@xen0n.name>
Subject: Re: [PATCH v1 1/2] LoongArch: Add missing headers
Date: Mon, 18 Sep 2023 09:49:49 +0300	[thread overview]
Message-ID: <ZQfzDXc0WRHCUeIq@smile.fi.intel.com> (raw)
In-Reply-To: <CAAhV-H6dakVH0a4Mt9MdcY8OO3gdne6rW0Z1kK6YRq9hDLP05w@mail.gmail.com>

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



  reply	other threads:[~2023-09-18  6:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2023-09-18  8:05             ` Huacai Chen
2023-09-18  8:23               ` Andy Shevchenko
2023-09-19  0:56                 ` Guo Ren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZQfzDXc0WRHCUeIq@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=chenhuacai@kernel.org \
    --cc=kernel@xen0n.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox