- Make the ptr argument const, to avoid adding casts in future callers, - Add a forward declaration, to avoid moving large blocks of code. Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx> --- lib/vsprintf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 095a677f89c02442..b5bf90731c5a5277 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -407,6 +407,9 @@ struct printf_spec { #define FIELD_WIDTH_MAX ((1 << 23) - 1) #define PRECISION_MAX ((1 << 15) - 1) +static char *ptr_to_id(char *buf, char *end, const void *ptr, + struct printf_spec spec); + static noinline_for_stack char *number(char *buf, char *end, unsigned long long num, struct printf_spec spec) @@ -1714,7 +1717,8 @@ static int __init initialize_ptr_random(void) early_initcall(initialize_ptr_random); /* Maps a pointer to a 32 bit unique identifier. */ -static char *ptr_to_id(char *buf, char *end, void *ptr, struct printf_spec spec) +static char *ptr_to_id(char *buf, char *end, const void *ptr, + struct printf_spec spec) { const char *str = sizeof(ptr) == 8 ? "(____ptrval____)" : "(ptrval)"; unsigned long hashval; -- 2.17.1