[RFC PATCH 1/2] Add U_BOOT_VERSION_CODE macro for packing the version number into a single int

Bence Cs csokas.bence at prolan.hu
Thu Dec 28 00:30:11 CET 2023


Signed-off-by: Bence Cs <csokas.bence at prolan.hu>
---
 include/version.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/version.h b/include/version.h
index 5955b21e89..a8753deadf 100644
--- a/include/version.h
+++ b/include/version.h
@@ -11,4 +11,7 @@
 #include "generated/version_autogenerated.h"
 #endif
 
+#define U_BOOT_VERSION_CODE(num, patch) (((num) << 8) | ((patch) & 0xFF))
+#define U_BOOT_CURRENT_VERSION_CODE U_BOOT_VERSION_CODE(U_BOOT_VERSION_NUM, U_BOOT_VERSION_NUM_PATCH)
+
 #endif	/* __VERSION_H__ */
-- 
2.25.1




More information about the U-Boot mailing list