From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754055AbeDYLNn (ORCPT ); Wed, 25 Apr 2018 07:13:43 -0400 Received: from mx2.suse.de ([195.135.220.15]:56887 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752823AbeDYLNg (ORCPT ); Wed, 25 Apr 2018 07:13:36 -0400 From: Petr Mladek To: Andy Shevchenko , Rasmus Villemoes Cc: Linus Torvalds , "Tobin C . Harding" , Joe Perches , Andrew Morton , Michal Hocko , Sergey Senozhatsky , Steven Rostedt , Sergey Senozhatsky , linux-kernel@vger.kernel.org, Petr Mladek Subject: [PATCH v5 02/11] vsprintf: Add missing const ptr qualifier to prt_to_id() Date: Wed, 25 Apr 2018 13:12:42 +0200 Message-Id: <20180425111251.13246-3-pmladek@suse.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180425111251.13246-1-pmladek@suse.com> References: <20180425111251.13246-1-pmladek@suse.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org vsprintf() must not change any data that parameters point to. Let's add the missing const qualifier to ptr_to_id(). This patch does not change the existing behavior. Signed-off-by: Petr Mladek --- lib/vsprintf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 19fdfe621b40..eef9f725e9ff 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -661,7 +661,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.13.6