public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Alejandro Colomar <alx@kernel.org>, Jonathan Cameron <jic23@kernel.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	Lucas Segarra Fernandez <lucas.segarra.fernandez@intel.com>,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
	qat-linux@intel.com,
	Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Subject: Re: [PATCH v2 1/2] crypto: qat - refactor included headers
Date: Thu, 31 Aug 2023 16:29:16 +0300	[thread overview]
Message-ID: <ZPCVrE8SqyAC7rG/@smile.fi.intel.com> (raw)
In-Reply-To: <88708464-cc1c-c31d-5cb0-171a41dec936@kernel.org>

On Thu, Aug 31, 2023 at 01:18:11PM +0200, Alejandro Colomar wrote:
> On 2023-08-31 05:55, Herbert Xu wrote:
> > On Tue, Aug 29, 2023 at 05:08:37PM +0300, Andy Shevchenko wrote:
> >>
> >> Do I understand correctly that you want *ideally* to have THE kernel.h
> >> as a _single_ header and that's it?
> > 
> > My rule of thumb for a .c file is that if you need more than two
> > headers directly included by kernel.h then you should just use
> > kernel.h.
> > 
> >> While I understand your motivation as a maintainer, I hate the idea of current
> >> kernel.h to be included as a silver bullet to every file because people are not
> >> capable to understand this C language part of design. The usage of the proper
> >> headers show that developer _thought_ very well about what they are doing in
> >> the driver. Neglecting this affects the quality of the code in my opinion.
> >> That's why I strongly recommend to avoid kernel.h inclusion unless it's indeed
> >> the one that provides something that is used in the driver. Even though, the
> >> rest headers also need to be included (as it wasn't done by kernel.h at any
> >> circumstances).
> > 
> > I have no qualms with fixing header files that include kernel.h
> > to include whatever it is that they need directly.  That is a
> > worthy goal and should be enforced for all new header files.
> > 
> > I just don't share your enthusiasm about doing the same for .c
> > files.
> 
> <https://include-what-you-use.org/
> 
> Maybe this is helpful, if you didn't know about it.  :)
> (I disagree with the forward declarations that are recommended there,
> though.)

Yeah, but IWYU is too radical and requires a lot of manual job done in
the kernel. Jonathan tried it at some point.

I prefer to have a balance here (not to include literally _everything_
what we are using, just generic enough).

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2023-08-31 14:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-18 10:23 [PATCH v2 0/2] Add debugfs pm_status for qat driver Lucas Segarra Fernandez
2023-08-18 10:23 ` [PATCH v2 1/2] crypto: qat - refactor included headers Lucas Segarra Fernandez
2023-08-25 10:36   ` Herbert Xu
2023-08-25 10:41     ` Herbert Xu
2023-08-25 11:00       ` Herbert Xu
2023-08-25 12:37     ` Andy Shevchenko
2023-08-28 10:22       ` Herbert Xu
2023-08-28 10:46         ` Andy Shevchenko
2023-08-29 10:18           ` Herbert Xu
2023-08-29 14:08             ` Andy Shevchenko
2023-08-31  3:55               ` Herbert Xu
2023-08-31 11:18                 ` Alejandro Colomar
2023-08-31 13:29                   ` Andy Shevchenko [this message]
2023-08-31 13:26                 ` Andy Shevchenko
2023-08-18 10:23 ` [PATCH v2 2/2] crypto: qat - add pm_status debugfs file Lucas Segarra Fernandez
2023-08-25 10:39   ` Herbert Xu
2023-08-25 12:38     ` Andy Shevchenko
2023-08-25 11:01   ` Herbert Xu

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=ZPCVrE8SqyAC7rG/@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=alx@kernel.org \
    --cc=giovanni.cabiddu@intel.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jic23@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucas.segarra.fernandez@intel.com \
    --cc=qat-linux@intel.com \
    /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