summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-08-22 07:55:01 -0600
committerTom Rini <trini@konsulko.com>2024-08-23 15:58:41 -0600
commit50a1ed4335045c57d9073a3fcd265edd89da924a (patch)
treecbdfbb72433c5bce3d3f86834940868b3ec3b7ce
parent2a00d73d081a14e7c2ecf23794b6d029268d8ca3 (diff)
spl: Use unified inline functions for spl_load_info
Rather than declaring completely separate functions, put the code for each case into the same function. This makes it easier to read. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
-rw-r--r--include/spl.h18
1 files changed, 7 insertions, 11 deletions
diff --git a/include/spl.h b/include/spl.h
index f92089b69ea..fb26e3f5537 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -306,31 +306,27 @@ struct spl_load_info {
void *buf);
#if IS_ENABLED(CONFIG_SPL_LOAD_BLOCK)
int bl_len;
+#endif
};
static inline int spl_get_bl_len(struct spl_load_info *info)
{
+#if IS_ENABLED(CONFIG_SPL_LOAD_BLOCK)
return info->bl_len;
-}
-
-static inline void spl_set_bl_len(struct spl_load_info *info, int bl_len)
-{
- info->bl_len = bl_len;
-}
#else
-};
-
-static inline int spl_get_bl_len(struct spl_load_info *info)
-{
return 1;
+#endif
}
static inline void spl_set_bl_len(struct spl_load_info *info, int bl_len)
{
+#if IS_ENABLED(CONFIG_SPL_LOAD_BLOCK)
+ info->bl_len = bl_len;
+#else
if (bl_len != 1)
panic("CONFIG_SPL_LOAD_BLOCK not enabled");
-}
#endif
+}
/*
* We need to know the position of U-Boot in memory so we can jump to it. We