public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] nvdimm: Remove duplicate linux/slab.h header
@ 2025-09-28  1:31 Jiapeng Chong
  2025-09-29  1:26 ` Alison Schofield
  0 siblings, 1 reply; 5+ messages in thread
From: Jiapeng Chong @ 2025-09-28  1:31 UTC (permalink / raw)
  To: dan.j.williams
  Cc: vishal.l.verma, dave.jiang, ira.weiny, nvdimm, linux-kernel,
	Jiapeng Chong, Abaci Robot

./drivers/nvdimm/bus.c: linux/slab.h is included more than once.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=25516
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/nvdimm/bus.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c
index ad3a0493f474..87178a53ff9c 100644
--- a/drivers/nvdimm/bus.c
+++ b/drivers/nvdimm/bus.c
@@ -13,7 +13,6 @@
 #include <linux/async.h>
 #include <linux/ndctl.h>
 #include <linux/sched.h>
-#include <linux/slab.h>
 #include <linux/cpu.h>
 #include <linux/fs.h>
 #include <linux/io.h>
-- 
2.43.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] nvdimm: Remove duplicate linux/slab.h header
  2025-09-28  1:31 [PATCH -next] nvdimm: Remove duplicate linux/slab.h header Jiapeng Chong
@ 2025-09-29  1:26 ` Alison Schofield
  2025-09-29 15:05   ` Ira Weiny
  0 siblings, 1 reply; 5+ messages in thread
From: Alison Schofield @ 2025-09-29  1:26 UTC (permalink / raw)
  To: Jiapeng Chong
  Cc: dan.j.williams, vishal.l.verma, dave.jiang, ira.weiny, nvdimm,
	linux-kernel, Abaci Robot

On Sun, Sep 28, 2025 at 09:31:10AM +0800, Jiapeng Chong wrote:
> ./drivers/nvdimm/bus.c: linux/slab.h is included more than once.

Hi Jiapeng,

It would have been useful here to note where else slab.h was included,
since it wasn't simply a duplicate #include in bus.c.

I found slab.h is also in #include <linux/fs.h>. Then I found that this
compiles if I remove both of those includes. It would be worthwhile to
check all the includes and send a new tested version of this patch that
does this "Remove needless #include's in bus.c"

BTW - I didn't check all #includes.There may be more beyond slab.h & fs.h.

--Alison

> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=25516
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/nvdimm/bus.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c
> index ad3a0493f474..87178a53ff9c 100644
> --- a/drivers/nvdimm/bus.c
> +++ b/drivers/nvdimm/bus.c
> @@ -13,7 +13,6 @@
>  #include <linux/async.h>
>  #include <linux/ndctl.h>
>  #include <linux/sched.h>
> -#include <linux/slab.h>
>  #include <linux/cpu.h>
>  #include <linux/fs.h>
>  #include <linux/io.h>
> -- 
> 2.43.5
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] nvdimm: Remove duplicate linux/slab.h header
  2025-09-29  1:26 ` Alison Schofield
@ 2025-09-29 15:05   ` Ira Weiny
  2025-09-29 17:23     ` Alison Schofield
  0 siblings, 1 reply; 5+ messages in thread
From: Ira Weiny @ 2025-09-29 15:05 UTC (permalink / raw)
  To: Alison Schofield, Jiapeng Chong
  Cc: dan.j.williams, vishal.l.verma, dave.jiang, ira.weiny, nvdimm,
	linux-kernel, Abaci Robot

Alison Schofield wrote:
> On Sun, Sep 28, 2025 at 09:31:10AM +0800, Jiapeng Chong wrote:
> > ./drivers/nvdimm/bus.c: linux/slab.h is included more than once.
> 
> Hi Jiapeng,
> 
> It would have been useful here to note where else slab.h was included,
> since it wasn't simply a duplicate #include in bus.c.

Actually Alison this is a bug against linux-next where it was an issue
with Dave's patch here:

https://lore.kernel.org/all/20250923174013.3319780-3-dave.jiang@intel.com/

I'll queue this up.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

Thanks,
Ira

> 
> I found slab.h is also in #include <linux/fs.h>. Then I found that this
> compiles if I remove both of those includes. It would be worthwhile to
> check all the includes and send a new tested version of this patch that
> does this "Remove needless #include's in bus.c"
> 
> BTW - I didn't check all #includes.There may be more beyond slab.h & fs.h.
> 
> --Alison
> 
> > 
> > Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> > Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=25516
> > Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> > ---
> >  drivers/nvdimm/bus.c | 1 -
> >  1 file changed, 1 deletion(-)
> > 
> > diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c
> > index ad3a0493f474..87178a53ff9c 100644
> > --- a/drivers/nvdimm/bus.c
> > +++ b/drivers/nvdimm/bus.c
> > @@ -13,7 +13,6 @@
> >  #include <linux/async.h>
> >  #include <linux/ndctl.h>
> >  #include <linux/sched.h>
> > -#include <linux/slab.h>
> >  #include <linux/cpu.h>
> >  #include <linux/fs.h>
> >  #include <linux/io.h>
> > -- 
> > 2.43.5
> > 
> > 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] nvdimm: Remove duplicate linux/slab.h header
  2025-09-29 15:05   ` Ira Weiny
@ 2025-09-29 17:23     ` Alison Schofield
  2025-09-30 19:34       ` dan.j.williams
  0 siblings, 1 reply; 5+ messages in thread
From: Alison Schofield @ 2025-09-29 17:23 UTC (permalink / raw)
  To: Ira Weiny
  Cc: Jiapeng Chong, dan.j.williams, vishal.l.verma, dave.jiang, nvdimm,
	linux-kernel, Abaci Robot

On Mon, Sep 29, 2025 at 10:05:31AM -0500, Ira Weiny wrote:
> Alison Schofield wrote:
> > On Sun, Sep 28, 2025 at 09:31:10AM +0800, Jiapeng Chong wrote:
> > > ./drivers/nvdimm/bus.c: linux/slab.h is included more than once.
> > 
> > Hi Jiapeng,
> > 
> > It would have been useful here to note where else slab.h was included,
> > since it wasn't simply a duplicate #include in bus.c.
> 
> Actually Alison this is a bug against linux-next where it was an issue
> with Dave's patch here:
> 
> https://lore.kernel.org/all/20250923174013.3319780-3-dave.jiang@intel.com/

Ah, I see this removes the dup that the above patch added.

Why not remove fs.h instead of slab.h and get a clean up and de-dup
in one shot?

> 
> I'll queue this up.
> 
> Reviewed-by: Ira Weiny <ira.weiny@intel.com>
> 
> Thanks,
> Ira
> 
> > 
> > I found slab.h is also in #include <linux/fs.h>. Then I found that this
> > compiles if I remove both of those includes. It would be worthwhile to
> > check all the includes and send a new tested version of this patch that
> > does this "Remove needless #include's in bus.c"
> > 
> > BTW - I didn't check all #includes.There may be more beyond slab.h & fs.h.
> > 
> > --Alison
> > 
> > > 
> > > Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> > > Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=25516
> > > Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> > > ---
> > >  drivers/nvdimm/bus.c | 1 -
> > >  1 file changed, 1 deletion(-)
> > > 
> > > diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c
> > > index ad3a0493f474..87178a53ff9c 100644
> > > --- a/drivers/nvdimm/bus.c
> > > +++ b/drivers/nvdimm/bus.c
> > > @@ -13,7 +13,6 @@
> > >  #include <linux/async.h>
> > >  #include <linux/ndctl.h>
> > >  #include <linux/sched.h>
> > > -#include <linux/slab.h>
> > >  #include <linux/cpu.h>
> > >  #include <linux/fs.h>
> > >  #include <linux/io.h>
> > > -- 
> > > 2.43.5
> > > 
> > > 
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] nvdimm: Remove duplicate linux/slab.h header
  2025-09-29 17:23     ` Alison Schofield
@ 2025-09-30 19:34       ` dan.j.williams
  0 siblings, 0 replies; 5+ messages in thread
From: dan.j.williams @ 2025-09-30 19:34 UTC (permalink / raw)
  To: Alison Schofield, Ira Weiny
  Cc: Jiapeng Chong, dan.j.williams, vishal.l.verma, dave.jiang, nvdimm,
	linux-kernel, Abaci Robot

Alison Schofield wrote:
> On Mon, Sep 29, 2025 at 10:05:31AM -0500, Ira Weiny wrote:
> > Alison Schofield wrote:
> > > On Sun, Sep 28, 2025 at 09:31:10AM +0800, Jiapeng Chong wrote:
> > > > ./drivers/nvdimm/bus.c: linux/slab.h is included more than once.
> > > 
> > > Hi Jiapeng,
> > > 
> > > It would have been useful here to note where else slab.h was included,
> > > since it wasn't simply a duplicate #include in bus.c.
> > 
> > Actually Alison this is a bug against linux-next where it was an issue
> > with Dave's patch here:
> > 
> > https://lore.kernel.org/all/20250923174013.3319780-3-dave.jiang@intel.com/
> 
> Ah, I see this removes the dup that the above patch added.
> 
> Why not remove fs.h instead of slab.h and get a clean up and de-dup
> in one shot?

fs.h is included for 'struct file_operations', so no clean up
opportunity there. Recall the "include what you use" recommendation:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submit-checklist.rst?id=v6.17-rc7#n17

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-09-30 19:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-28  1:31 [PATCH -next] nvdimm: Remove duplicate linux/slab.h header Jiapeng Chong
2025-09-29  1:26 ` Alison Schofield
2025-09-29 15:05   ` Ira Weiny
2025-09-29 17:23     ` Alison Schofield
2025-09-30 19:34       ` dan.j.williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox