lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <88708464-cc1c-c31d-5cb0-171a41dec936@kernel.org>
Date:   Thu, 31 Aug 2023 13:18:11 +0200
From:   Alejandro Colomar <alx@...nel.org>
To:     Herbert Xu <herbert@...dor.apana.org.au>,
        Andy Shevchenko <andriy.shevchenko@...el.com>
Cc:     Lucas Segarra Fernandez <lucas.segarra.fernandez@...el.com>,
        linux-kernel@...r.kernel.org, linux-crypto@...r.kernel.org,
        qat-linux@...el.com, Giovanni Cabiddu <giovanni.cabiddu@...el.com>
Subject: Re: [PATCH v2 1/2] crypto: qat - refactor included headers

Hi Herbert,

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.)

Cheers,
Alex

> 
> Cheers,

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5



Download attachment "OpenPGP_signature" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ