Patchwork Include "flash.h" and <inttypes.h> in chipdrivers.h

login
register
about
Submitter David Hendricks
Date 2010-12-15 22:07:31
Message ID <AANLkTi=5Vb+UNAc+yyUz4067d6azztU5XEEz44p5p+RA@mail.gmail.com>
Download mbox | patch
Permalink /patch/2436/
State Accepted
Commit 1414
Headers show

Comments

David Hendricks - 2010-12-15 22:07:31
oops -- forgot to attach the patch. Since it's tiny, I'll just post it
in-line:


Signed-off-by: David Hendricks <dhendrix@google.com>

On Wed, Dec 15, 2010 at 2:05 PM, David Hendricks <dhendrix@google.com>wrote:

> This patch is intended to avoid compilation issues caused by the ordering
> of #includes in source files that use chipdrivers.h.
>
> Signed-off-by: David Hendricks <dhendrix@google.com>
>
> --
> David Hendricks (dhendrix)
> Systems Software Engineer, Google Inc.
>
Stefan Tauner - 2011-07-10 12:16:11
> oops -- forgot to attach the patch. Since it's tiny, I'll just post it
> in-line:
> 
> Index: chipdrivers.h
> ===================================================================
> --- chipdrivers.h       (revision 1247)
> +++ chipdrivers.h       (working copy)
> @@ -25,6 +25,10 @@
>  #ifndef __CHIPDRIVERS_H__
>  #define __CHIPDRIVERS_H__ 1
> 
> +#include <inttypes.h>
> +
> +#include "flash.h"     /* for chipaddr and flashchip */
> +
>  /* spi.c, should probably be in spi_chip.c */
>  int probe_spi_rdid(struct flashchip *flash);
>  int probe_spi_rdid4(struct flashchip *flash);
> 
> Signed-off-by: David Hendricks <dhendrix at google.com>
> 
> On Wed, Dec 15, 2010 at 2:05 PM, David Hendricks <dhendrix at google.com>wrote:
> 
> > This patch is intended to avoid compilation issues caused by the ordering
> > of #includes in source files that use chipdrivers.h.
> >
> > Signed-off-by: David Hendricks <dhendrix at google.com>

i noticed the missing flash.h too a few times and i think it should be
included. the comment could be dropped because it is obvious.

the inttypes (or stdint) is probably not needed because flash.h brings
that in anyway. personally, i would add it nonetheless, but there were
patches that removed "duplicate includes" (e.g. r1196)...
Stefan Tauner - 2011-08-16 12:09:45
On Sun, 10 Jul 2011 14:16:11 +0200
Stefan Tauner <stefan.tauner@student.tuwien.ac.at> wrote:

> > oops -- forgot to attach the patch. Since it's tiny, I'll just post it
> > in-line:
> > 
> > Index: chipdrivers.h
> > ===================================================================
> > --- chipdrivers.h       (revision 1247)
> > +++ chipdrivers.h       (working copy)
> > @@ -25,6 +25,10 @@
> >  #ifndef __CHIPDRIVERS_H__
> >  #define __CHIPDRIVERS_H__ 1
> > 
> > +#include <inttypes.h>
> > +
> > +#include "flash.h"     /* for chipaddr and flashchip */
> > +
> >  /* spi.c, should probably be in spi_chip.c */
> >  int probe_spi_rdid(struct flashchip *flash);
> >  int probe_spi_rdid4(struct flashchip *flash);
> > 
> > Signed-off-by: David Hendricks <dhendrix at google.com>
> > 
> > On Wed, Dec 15, 2010 at 2:05 PM, David Hendricks <dhendrix at google.com>wrote:
> > 
> > > This patch is intended to avoid compilation issues caused by the ordering
> > > of #includes in source files that use chipdrivers.h.
> > >
> > > Signed-off-by: David Hendricks <dhendrix at google.com>
> 
> i noticed the missing flash.h too a few times and i think it should be
> included. the comment could be dropped because it is obvious.
> 
> the inttypes (or stdint) is probably not needed because flash.h brings
> that in anyway. personally, i would add it nonetheless, but there were
> patches that removed "duplicate includes" (e.g. r1196)...
> 

i have added flash.h there as part of r1414

Patch

Index: chipdrivers.h
===================================================================
--- chipdrivers.h       (revision 1247)
+++ chipdrivers.h       (working copy)
@@ -25,6 +25,10 @@ 
 #ifndef __CHIPDRIVERS_H__
 #define __CHIPDRIVERS_H__ 1

+#include <inttypes.h>
+
+#include "flash.h"     /* for chipaddr and flashchip */
+
 /* spi.c, should probably be in spi_chip.c */
 int probe_spi_rdid(struct flashchip *flash);
 int probe_spi_rdid4(struct flashchip *flash);