Skip to content

Commit

Permalink
x86/boot: Fix a sanity check in printf.c
Browse files Browse the repository at this point in the history
Prior to 9b706ae ("x86: trivial printk optimizations") this was
36 because it had 26 characters and 10 digits but now it's just
16 hex digits so the sanity check needs updated.

This function is always called with a valid "base" so it doesn't
make a difference to how the kernel works, it's just a cleanup.

Reported-by: Alexey Petrenko <alexey.petrenko@oracle.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Dan Carpenter authored and Ingo Molnar committed Aug 14, 2013
1 parent 28fbc8b commit 5b8fafc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/boot/printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static char *number(char *str, long num, int base, int size, int precision,
locase = (type & SMALL);
if (type & LEFT)
type &= ~ZEROPAD;
if (base < 2 || base > 36)
if (base < 2 || base > 16)
return NULL;
c = (type & ZEROPAD) ? '0' : ' ';
sign = 0;
Expand Down

0 comments on commit 5b8fafc

Please sign in to comment.