Re: [PATCH v8 4/4] scanf: break kunit into test cases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 05, 2025 at 04:01:48PM +0100, Petr Mladek wrote:
> On Fri 2025-02-14 11:20:01, Tamir Duberstein wrote:

...

> >  #include <kunit/test.h>
> > -#include <linux/bitops.h>
> > -#include <linux/kernel.h>
> >  #include <linux/module.h>
> > -#include <linux/overflow.h>
> > -#include <linux/printk.h>
> >  #include <linux/prandom.h>
> >  #include <linux/slab.h>
> > -#include <linux/string.h>
> > +#include <linux/sprintf.h>
> >  
> >  #define BUF_SIZE 1024
> 
> It would make more sense to do this clean up in the 3rd patch
> where some code was replaced by the kunit macros.

+1.

> Also I am not sure about the choice. It might make sense to remove
> <include/printk.h> because the pr_*() calls were removed.
> But what about the others? Did anyone request the clean up, please?

Header inclusions is a pain point to me in the kernel. Esp. misuse of kernel.h
or other headers to behave like a "proxy". If no-one even asked for a cleanup
it's always good to follow IWYU principle as you mentioned below.

> I do not want to open a bike shadding because different people
> have different opinion.
> 
> I would personally prefer to keep the explicit includes when the
> related API is still used. It helps to optimize nested includes
> in the header files which helps to speedup build. AFAIK, there
> are people working in this optimization and they might need
> to revert this change.

+1.

-- 
With Best Regards,
Andy Shevchenko






[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux