public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Heikki Huttu <heissendo88@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] staging: vme_user: add missing includes
Date: Sat, 24 May 2025 18:17:51 +0200	[thread overview]
Message-ID: <2025052448-overuse-demise-d090@gregkh> (raw)
In-Reply-To: <aDHvSicbJpYBY-dn@Lappari.v6.elisa-laajakaista.fi>

On Sat, May 24, 2025 at 07:09:46PM +0300, Heikki Huttu wrote:
> Wed, May 21, 2025 at 01:43:24PM +0200, Greg KH kirjoitti:
> > On Thu, May 15, 2025 at 10:40:13PM +0300, Heikki Huttu wrote:
> > > Header files use u32, size_t, dma_addr_t, struct device, struct list_head.
> > > Add direct includes to make the headers self-contained.
> > > 
> > > Signed-off-by: Heikki Huttu <heissendo88@gmail.com>
> > > ---
> > >  drivers/staging/vme_user/vme.h      | 5 +++++
> > >  drivers/staging/vme_user/vme_user.h | 2 ++
> > >  2 files changed, 7 insertions(+)
> > > 
> > > diff --git a/drivers/staging/vme_user/vme.h b/drivers/staging/vme_user/vme.h
> > > index 7753e736f9fd..55499b240dc3 100644
> > > --- a/drivers/staging/vme_user/vme.h
> > > +++ b/drivers/staging/vme_user/vme.h
> > > @@ -3,6 +3,11 @@
> > >  #define _VME_H_
> > >  
> > >  #include <linux/bitops.h>
> > > +#include <linux/types.h>
> > > +#include <linux/device.h>
> > > +#include <linux/list.h>
> > > +#include <linux/mm.h>
> > > +#include <linux/dma-mapping.h>
> > 
> > If you are going to add these, please do so in a sorted way.
> > 
> > But really, why is this needed at all?
> > 
> > >  
> > >  /* Resource Type */
> > >  enum vme_resource_type {
> > > diff --git a/drivers/staging/vme_user/vme_user.h b/drivers/staging/vme_user/vme_user.h
> > > index 19ecb05781cc..297b25fab164 100644
> > > --- a/drivers/staging/vme_user/vme_user.h
> > > +++ b/drivers/staging/vme_user/vme_user.h
> > > @@ -2,6 +2,8 @@
> > >  #ifndef _VME_USER_H_
> > >  #define _VME_USER_H_
> > >  
> > > +#include <linux/types.h>
> > 
> > Same here, are you sure this is needed?
> > 
> > thanks,
> > 
> > greg k-h
> 
> Hi Greg,
> 
> Thank you for the feedback.
> 
> I was under the impression that it's generally preferred to use direct includes to make headers self-contained and avoid relying on transitive includes.  
> If I was mistaken, apologies — feel free to disregard this.

Generally, yes, it is a good idea, but if nothing is broken, adding
additional .h files to other .h files is not a required change at all.

Are you doing this for all of the staging driver files?  Is this a goal
to try to fix up more than just this one file?

thanks,

greg k-h

      reply	other threads:[~2025-05-24 16:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-15 19:40 [PATCH] staging: vme_user: add missing includes Heikki Huttu
2025-05-21 11:43 ` Greg KH
2025-05-24 16:09   ` Heikki Huttu
2025-05-24 16:17     ` Greg KH [this message]

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=2025052448-overuse-demise-d090@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=heissendo88@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /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