From: AKASHI Takahiro Date: Wed, 5 Sep 2018 10:14:13 +0900 Subject: [U-Boot] [PATCH v2 01/23] fs: fat: guard the content of include/fat.h In-Reply-To: <71b5287f-2a0d-c639-5b66-3ae0e21ab159@suse.de> References: <20180904074948.18146-1-takahiro.akashi@linaro.org> <20180904074948.18146-2-takahiro.akashi@linaro.org> <71b5287f-2a0d-c639-5b66-3ae0e21ab159@suse.de> Message-ID: <20180905011411.GB18483@linaro.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Sep 04, 2018 at 10:52:20AM +0200, Alexander Graf wrote: > > > On 04.09.18 09:49, AKASHI Takahiro wrote: > > The whole content of include/fat.h is private to FAT implementation > > and then should be guarded with CONFIG_FS_FAT. > > > > Signed-off-by: AKASHI Takahiro > > --- > > include/fat.h | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/include/fat.h b/include/fat.h > > index 09e142368585..c02839dcb040 100644 > > --- a/include/fat.h > > +++ b/include/fat.h > > @@ -9,6 +9,8 @@ > > #ifndef _FAT_H_ > > #define _FAT_H_ > > > > +#ifdef CONFIG_FS_FAT > > Isn't this missing an include of at least common.h to actually propagate > the config define? > > Also, you want to use #if CONFIG_IS_ENABLED(...) here to guard against > SPL builds too. Let's discuss in a reply to Heinrich's comment. > However, I don't fully grasp why you need this patch. Please describe in > your commit message what the incentive is for creating it. What errors > are you trying to protect against? Sure; See https://lists.denx.de/pipermail/u-boot/2018-August/338054.html In short, one macro definition in this file will break without CONFI_FS_FAT_*. Thanks, -Takahiro AKASHI > > Alex > > > + > > #include > > #include > > > > @@ -202,4 +204,5 @@ int fat_opendir(const char *filename, struct fs_dir_stream **dirsp); > > int fat_readdir(struct fs_dir_stream *dirs, struct fs_dirent **dentp); > > void fat_closedir(struct fs_dir_stream *dirs); > > void fat_close(void); > > +#endif /* CONFIG_FS_FAT */ > > #endif /* _FAT_H_ */ > >