From d6224b3ee6fc64afa9a0033b624df3f881abb1a9 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Thu, 14 Feb 2019 20:48:21 +0800 Subject: [PATCH] lib/vsprintf: Make ptr argument conts in ptr_to_id() mainline inclusion from mainline-4.20 commit f31b224c14fd category: bugfix bugzilla: 5743 CVE: NA ------------------------------------------------- Make the ptr argument const to avoid adding casts in future callers. Link: http://lkml.kernel.org/r/20181011084249.4520-2-geert+renesas@glider.be To: "Tobin C . Harding" To: Andrew Morton To: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Geert Uytterhoeven Reviewed-by: Andy Shevchenko [pmladek@suse.com: split into separate patch] Signed-off-by: Petr Mladek Signed-off-by: Cheng Jian Reviewed-by: Xie XiuQi Signed-off-by: Yang Yingliang --- lib/vsprintf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 812e59e13fe6..a53ee1f6fc24 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -1709,7 +1709,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; -- GitLab