summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2019-06-07 17:47:40 +0200
committerNico Huber <nico.h@gmx.de>2019-06-09 11:53:34 +0000
commit930660027d9056a6a0b40100d878537e269f439c (patch)
tree243b3a351681590d26ef3a1a3bee6ff0acbc7ab9
parentac3772c7b5a245543d22f503cc8ad0eafcf927b8 (diff)
downloadflashrom-1.1.tar.gz
flashrom-1.1.tar.bz2
flashrom-1.1.zip
libflashrom: Add CPP guard to fix big-endian buildsv1.1
Calm a compiler warning on big-endian builds about the unused static flashrom_layout_parse_fmap(). The guard is ugly but gets the job done. We should forbid endian-specific code in the future, I guess. Change-Id: Id3f4a57e027f88cc469ed50312adddcc8af71a63 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/33297 Reviewed-by: Angel Pons <th3fanbus@gmail.com>
-rw-r--r--libflashrom.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libflashrom.c b/libflashrom.c
index f90a22cbc..c327c6256 100644
--- a/libflashrom.c
+++ b/libflashrom.c
@@ -383,6 +383,7 @@ _free_ret:
#endif
}
+#ifdef __FLASHROM_LITTLE_ENDIAN__
static int flashrom_layout_parse_fmap(struct flashrom_layout **layout,
struct flashctx *const flashctx, const struct fmap *const fmap)
{
@@ -414,6 +415,7 @@ static int flashrom_layout_parse_fmap(struct flashrom_layout **layout,
*layout = l;
return 0;
}
+#endif /* __FLASHROM_LITTLE_ENDIAN__ */
/**
* @brief Read a layout by searching the flash chip for fmap.