[PATCH v8 07/10] lib: add basic KUnit test for lib/math

Andy Shevchenko andriy.shevchenko at linux.intel.com
Mon May 20 12:22:47 UTC 2024


On Mon, May 20, 2024 at 05:11:18PM +0530, Devarsh Thakkar wrote:
> On 18/05/24 01:44, Andy Shevchenko wrote:
> > On Fri, May 17, 2024 at 11:06:07PM +0530, Devarsh Thakkar wrote:

[..]

> >> +#include <kunit/test.h>
> >> +#include <linux/gcd.h>
> > 
> >> +#include <linux/kernel.h>
> > 
> > Do you know why this header is included?
> 
> It includes all the other required headers (including those you mentioned
> below), and header list is probably copied from other files in same directory.
> But it does suffice the requirements as I have verified the compilation.

Yes, and one should follow IWYU principle and not cargo cult or whatever
arbitrary lists.

> >> +#include <linux/lcm.h>
> > 
> > + math.h // obviously
> > + module.h
> > 
> >> +#include <linux/reciprocal_div.h>
> > 
> > + types.h
> 
> All the above headers are already included as part of kernel.h

Yes, that's why you should not use "proxy" headers.
Have you read the top comment in the kernel.h?

-- 
With Best Regards,
Andy Shevchenko




More information about the dri-devel mailing list