[PATCHv2,1/2] mfd: cpcap: Add missing include dependencies
diff mbox series

Message ID 20170322000912.24210-1-sre@kernel.org
State New, archived
Headers show
Series
  • [PATCHv2,1/2] mfd: cpcap: Add missing include dependencies
Related show

Commit Message

Sebastian Reichel March 22, 2017, 12:09 a.m. UTC
This fixes compilation for files, that try to include the
cpcap header in alphabetically sorted #include lists.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
---
This patch is new, since PATCHv1 did not order the includes
in the led driver alphabetically.
---
 include/linux/mfd/motorola-cpcap.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Pavel Machek March 22, 2017, 9:27 a.m. UTC | #1
On Wed 2017-03-22 01:09:11, Sebastian Reichel wrote:
> This fixes compilation for files, that try to include the
> cpcap header in alphabetically sorted #include lists.
> 
> Signed-off-by: Sebastian Reichel <sre@kernel.org>

Acked-by: Pavel Machek <pavel@ucw.cz>

> ---
> This patch is new, since PATCHv1 did not order the includes
> in the led driver alphabetically.
> ---
>  include/linux/mfd/motorola-cpcap.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/include/linux/mfd/motorola-cpcap.h b/include/linux/mfd/motorola-cpcap.h
> index 7629e0d24d26..b8916953a537 100644
> --- a/include/linux/mfd/motorola-cpcap.h
> +++ b/include/linux/mfd/motorola-cpcap.h
> @@ -14,6 +14,9 @@
>   * published by the Free Software Foundation.
>   */
>  
> +#include <linux/device.h>
> +#include <linux/regmap.h>
> +
>  #define CPCAP_VENDOR_ST		0
>  #define CPCAP_VENDOR_TI		1
>
Tony Lindgren March 22, 2017, 3:57 p.m. UTC | #2
* Pavel Machek <pavel@ucw.cz> [170322 02:29]:
> On Wed 2017-03-22 01:09:11, Sebastian Reichel wrote:
> > This fixes compilation for files, that try to include the
> > cpcap header in alphabetically sorted #include lists.
> > 
> > Signed-off-by: Sebastian Reichel <sre@kernel.org>
> 
> Acked-by: Pavel Machek <pavel@ucw.cz>

Hmm I wonder why I never ran into this so far. No objections
to the patch though if it fixes the issue with all the necessary
headers included.

Regards,

Tony


> > ---
> > This patch is new, since PATCHv1 did not order the includes
> > in the led driver alphabetically.
> > ---
> >  include/linux/mfd/motorola-cpcap.h | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/include/linux/mfd/motorola-cpcap.h b/include/linux/mfd/motorola-cpcap.h
> > index 7629e0d24d26..b8916953a537 100644
> > --- a/include/linux/mfd/motorola-cpcap.h
> > +++ b/include/linux/mfd/motorola-cpcap.h
> > @@ -14,6 +14,9 @@
> >   * published by the Free Software Foundation.
> >   */
> >  
> > +#include <linux/device.h>
> > +#include <linux/regmap.h>
> > +
> >  #define CPCAP_VENDOR_ST		0
> >  #define CPCAP_VENDOR_TI		1
> >  
> 
> -- 
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Sebastian Reichel March 23, 2017, 1 a.m. UTC | #3
Hi,

On Wed, Mar 22, 2017 at 08:57:16AM -0700, Tony Lindgren wrote:
> * Pavel Machek <pavel@ucw.cz> [170322 02:29]:
> > On Wed 2017-03-22 01:09:11, Sebastian Reichel wrote:
> > > This fixes compilation for files, that try to include the
> > > cpcap header in alphabetically sorted #include lists.
> > > 
> > > Signed-off-by: Sebastian Reichel <sre@kernel.org>
> > 
> > Acked-by: Pavel Machek <pavel@ucw.cz>
> 
> Hmm I wonder why I never ran into this so far. No objections
> to the patch though if it fixes the issue with all the necessary
> headers included.

Because you usually sort includes differently moving headers
from linux/subdir/XYZ after linux/XYZ. That way regmap.h and
device.h will already be included when the compiler includes
motorola-cpcap.h.

-- Sebastian
Tony Lindgren March 23, 2017, 2:52 p.m. UTC | #4
* Sebastian Reichel <sre@kernel.org> [170322 18:02]:
> Hi,
> 
> On Wed, Mar 22, 2017 at 08:57:16AM -0700, Tony Lindgren wrote:
> > * Pavel Machek <pavel@ucw.cz> [170322 02:29]:
> > > On Wed 2017-03-22 01:09:11, Sebastian Reichel wrote:
> > > > This fixes compilation for files, that try to include the
> > > > cpcap header in alphabetically sorted #include lists.
> > > > 
> > > > Signed-off-by: Sebastian Reichel <sre@kernel.org>
> > > 
> > > Acked-by: Pavel Machek <pavel@ucw.cz>
> > 
> > Hmm I wonder why I never ran into this so far. No objections
> > to the patch though if it fixes the issue with all the necessary
> > headers included.
> 
> Because you usually sort includes differently moving headers
> from linux/subdir/XYZ after linux/XYZ. That way regmap.h and
> device.h will already be included when the compiler includes
> motorola-cpcap.h.

Ah OK yeah I do that usually. Your patch seems OK to me:

Acked-by: Tony Lindgren <tony@atomide.com>

Patch
diff mbox series

diff --git a/include/linux/mfd/motorola-cpcap.h b/include/linux/mfd/motorola-cpcap.h
index 7629e0d24d26..b8916953a537 100644
--- a/include/linux/mfd/motorola-cpcap.h
+++ b/include/linux/mfd/motorola-cpcap.h
@@ -14,6 +14,9 @@ 
  * published by the Free Software Foundation.
  */
 
+#include <linux/device.h>
+#include <linux/regmap.h>
+
 #define CPCAP_VENDOR_ST		0
 #define CPCAP_VENDOR_TI		1