diff mbox series

[v5,19/29] image: Tidy up fit_unsupported_reset()

Message ID 20210926014342.127913-13-sjg@chromium.org
State Accepted
Commit 0ab5e027045f78973b7b7d52a71a89a707398f9f
Delegated to: Tom Rini
Headers show
Series image: Reduce #ifdefs and ad-hoc defines in image code (Part B) | expand

Commit Message

Simon Glass Sept. 26, 2021, 1:43 a.m. UTC
This function is only used in one place and does not need to use the
preprocessor. Move it to the C file and convert it to a normal function.

Drop fit_unsupported() since it is not used.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 common/bootm_os.c |  8 ++++++++
 include/image.h   | 13 -------------
 2 files changed, 8 insertions(+), 13 deletions(-)

Comments

Tom Rini Oct. 9, 2021, 1:40 a.m. UTC | #1
On Sat, Sep 25, 2021 at 07:43:32PM -0600, Simon Glass wrote:

> This function is only used in one place and does not need to use the
> preprocessor. Move it to the C file and convert it to a normal function.
> 
> Drop fit_unsupported() since it is not used.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/common/bootm_os.c b/common/bootm_os.c
index d635037064a..39623f9126b 100644
--- a/common/bootm_os.c
+++ b/common/bootm_os.c
@@ -58,6 +58,14 @@  static void copy_args(char *dest, int argc, char *const argv[], char delim)
 }
 #endif
 
+static void __maybe_unused fit_unsupported_reset(const char *msg)
+{
+	if (CONFIG_IS_ENABLED(FIT_VERBOSE)) {
+		printf("! FIT images not supported for '%s' - must reset board to recover!\n",
+		       msg);
+	}
+}
+
 #ifdef CONFIG_BOOTM_NETBSD
 static int do_bootm_netbsd(int flag, int argc, char *const argv[],
 			   bootm_headers_t *images)
diff --git a/include/image.h b/include/image.h
index 75a63db4c1a..0dd8481611e 100644
--- a/include/image.h
+++ b/include/image.h
@@ -1413,19 +1413,6 @@  int fit_image_cipher_get_algo(const void *fit, int noffset, char **algo);
 
 struct cipher_algo *image_get_cipher_algo(const char *full_name);
 
-#if CONFIG_IS_ENABLED(FIT_VERBOSE)
-#define fit_unsupported(msg)	printf("! %s:%d " \
-				"FIT images not supported for '%s'\n", \
-				__FILE__, __LINE__, (msg))
-
-#define fit_unsupported_reset(msg)	printf("! %s:%d " \
-				"FIT images not supported for '%s' " \
-				"- must reset board to recover!\n", \
-				__FILE__, __LINE__, (msg))
-#else
-#define fit_unsupported(msg)
-#define fit_unsupported_reset(msg)
-#endif /* FIT_VERBOSE */
 #endif /* CONFIG_FIT */
 
 #if !defined(USE_HOSTCC)