Skip to content

Commit 6dad2d3

Browse files
Paolo 'Blaisorblade' GiarrussoLinus Torvalds
authored andcommitted
[PATCH] uml: fix 2 harmless cast warnings for 64-bit
Fix two harmless warnings in 64-bit compilation (the 2nd doesn't trigger for now because of a missing __attribute((format)) for cow_printf, but next patches fix that). Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent f2ea394 commit 6dad2d3

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎arch/um/drivers/cow_user.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,9 @@ int write_cow_header(char *cow_file, int fd, char *backing_file,
210210

211211
err = -EINVAL;
212212
if(strlen(backing_file) > sizeof(header->backing_file) - 1){
213+
/* Below, %zd is for a size_t value */
213214
cow_printf("Backing file name \"%s\" is too long - names are "
214-
"limited to %d characters\n", backing_file,
215+
"limited to %zd characters\n", backing_file,
215216
sizeof(header->backing_file) - 1);
216217
goto out_free;
217218
}

‎arch/um/drivers/mconsole_kern.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ static void console_write(struct console *console, const char *string,
615615
return;
616616

617617
while(1){
618-
n = min((size_t)len, ARRAY_SIZE(console_buf) - console_index);
618+
n = min((size_t) len, ARRAY_SIZE(console_buf) - console_index);
619619
strncpy(&console_buf[console_index], string, n);
620620
console_index += n;
621621
string += n;

0 commit comments

Comments
 (0)