Skip to content

Commit 8c1bb04

Browse files
Kwibookeveryang
authored andcommitted
cmd: ini: Fix build warning
Building U-Boot with CMD_INI=y result in following build warning: cmd/ini.c: In function 'memgets': include/linux/kernel.h:184:24: warning: comparison of distinct pointer types lacks a cast 184 | (void) (&_min1 == &_min2); \ | ^~ cmd/ini.c:92:15: note: in expansion of macro 'min' 92 | len = min((end - *mem) + newline, num); | ^~~ Fix this by adding an int cast to the pointer arithmetic result. Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Kever Yang <[email protected]>
1 parent 7af6616 commit 8c1bb04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/ini.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static char *memgets(char *str, int num, char **mem, size_t *memsize)
8989
end = *mem + *memsize;
9090
newline = 0;
9191
}
92-
len = min((end - *mem) + newline, num);
92+
len = min((int)(end - *mem) + newline, num);
9393
memcpy(str, *mem, len);
9494
if (len < num)
9595
str[len] = '\0';

0 commit comments

Comments
 (0)