From ee13d0c8fa365455002b109ded7f94f990be8347 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Fri, 7 Jun 2019 17:47:40 +0200 Subject: libflashrom: Add CPP guard to fix big-endian builds 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 Reviewed-on: https://review.coreboot.org/c/flashrom/+/33306 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- libflashrom.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libflashrom.c b/libflashrom.c index c5e56ae14..fee60ffd1 100644 --- a/libflashrom.c +++ b/libflashrom.c @@ -386,6 +386,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) { @@ -417,6 +418,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. -- cgit v1.2.3