[PATCH] lib: sbi: Fix printf handling of long long

dramforever dramforever at live.com
Wed Jul 27 07:07:39 PDT 2022


Do not attempt to unnecessarily align va_list before reading long long
arguments.

Signed-off-by: dramforever <dramforever at live.com>
---
 lib/sbi/sbi_console.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/lib/sbi/sbi_console.c b/lib/sbi/sbi_console.c
index 34c843d..7af50e5 100644
--- a/lib/sbi/sbi_console.c
+++ b/lib/sbi/sbi_console.c
@@ -261,11 +261,6 @@ static int print(char **out, u32 *out_len, const char *format, va_list args)
 				continue;
 			}
 			if (*format == 'l' && *(format + 1) == 'l') {
-				while (acnt &
-				       (sizeof(unsigned long long) - 1)) {
-					va_arg(args, int);
-					acnt += sizeof(int);
-				}
 				if (sizeof(unsigned long long) ==
 				    sizeof(unsigned long)) {
 					tmp = va_arg(args, unsigned long long);
-- 
2.37.0




More information about the opensbi mailing list