Skip to content

Commit

Permalink
um: use %lx format specifiers for unsigned longs
Browse files Browse the repository at this point in the history
static analysis from cppcheck detected %x being used for
unsigned longs:

[arch/x86/um/os-Linux/task_size.c:112]: (warning) %x in format
  string (no. 1) requires 'unsigned int' but the argument type
  is 'unsigned long'.

Use %lx instead of %x

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
Colin Ian King authored and Richard Weinberger committed Mar 5, 2016
1 parent 0834f9c commit ad32a1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/um/os-Linux/task_size.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ unsigned long os_get_top_address(void)
exit(1);
}

printf("0x%x\n", bottom << UM_KERN_PAGE_SHIFT);
printf("0x%lx\n", bottom << UM_KERN_PAGE_SHIFT);
printf("Locating the top of the address space ... ");
fflush(stdout);

Expand All @@ -134,7 +134,7 @@ unsigned long os_get_top_address(void)
exit(1);
}
top <<= UM_KERN_PAGE_SHIFT;
printf("0x%x\n", top);
printf("0x%lx\n", top);

return top;
}
Expand Down

0 comments on commit ad32a1f

Please sign in to comment.