Received: by 10.223.176.5 with SMTP id f5csp2311350wra; Mon, 5 Feb 2018 01:46:50 -0800 (PST) X-Google-Smtp-Source: AH8x225zDKZjq34PcV/GMuGvmnFT0mf0Ji5g/w3EChGeeoi5iZPTyDvRbUhH+l8pVh1qVPXBfKab X-Received: by 2002:a17:902:60c7:: with SMTP id k7-v6mr6876200pln.316.1517824010575; Mon, 05 Feb 2018 01:46:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517824010; cv=none; d=google.com; s=arc-20160816; b=0JhIZnhxWDKKZr9fOVf2xgluJOU96P+YItVWHoYR9Ctqo4VvKVuiZeXVBLasPKYXH4 cwGLgTewGK23l4Tz4aqc/jvN0tMDZ4FQdJmjO0s3QiJUbCoV2eGfZa16WHsZw3TcPiAr ti1hfpGF5jSb16y4X7acsv9GHtSghGzedo9e5psieHZ2s+FX6fQIy0WnqLO8yU6qQNtk kuwkyjWI4yZRJNUtPpSs9UiIAroaFGsjS0rMtUF9rmAogCig/iyjxy5l3dywxaLymIQJ HIM26798JSyYIZThuZzGob7f7EjIgbf/yb7WbpIa/d90j2iCr+z6kHHO/05Kx40nS1dJ 8H3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Md55hSqO7NIU61eJi4uoV0JXzjelwEK1IDHVHYx7t20=; b=asSNI1cfNmZRXgznKrZFP4mx2bGFRN8R5G9t4CumvhYUtgB/t+24iGhCWjBVjtW4CN kvgnZ1/wFWoH7jgOG/l9wJj/jgbxJ8UbywuI1HXXHvwBEnKnOsZpYHC2K0XDzLNCzPX5 3tXbof03qF9Kfn1VYLQI8ZaZFvPz8Ks+6tsGGM6VnGg1S1m/RqsDl8edPKE51I+73Cbb VcFnRMR40X5znAYivaFhmJdLbE6dWlqQd9+zdva/hXM0npWVyz3MfuE1VFP0FA7viGZk Q6Omu7PvjuTAAvQgqNYmHfjH732jfpshJgI4+46olslAAWNhCps7VMmdBZsRFbWy7m6T ytkw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n128si2507002pgn.752.2018.02.05.01.46.35; Mon, 05 Feb 2018 01:46:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752787AbeBEJox (ORCPT + 99 others); Mon, 5 Feb 2018 04:44:53 -0500 Received: from mx2.suse.de ([195.135.220.15]:40342 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751834AbeBEJos (ORCPT ); Mon, 5 Feb 2018 04:44:48 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 1283BAAEF; Mon, 5 Feb 2018 09:44:46 +0000 (UTC) Date: Mon, 5 Feb 2018 10:44:38 +0100 From: Petr Mladek To: Adam Borowski Cc: Sergey Senozhatsky , Steven Rostedt , linux-kernel@vger.kernel.org, "Tobin C. Harding" , Andrew Morton , Joe Perches , Kees Cook , "Roberts, William C" , Linus Torvalds , David Laight , Randy Dunlap , Geert Uytterhoeven Subject: Re: [PATCH] vsprintf: avoid misleading "(null)" for %px Message-ID: <20180205094438.pfd7ffymlvklpxe7@pathway.suse.cz> References: <20180204174521.21383-1-kilobyte@angband.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180204174521.21383-1-kilobyte@angband.pl> User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I add people who actively commented on adding %px modifier, see the thread starting at https://lkml.kernel.org/r/1511921105-3647-5-git-send-email-me@tobin.cc Just for reference. It seems to be related to the commit 9f36e2c448007b54 ("printk: use %pK for /proc/kallsyms and /proc/modules"). On Sun 2018-02-04 18:45:21, Adam Borowski wrote: > Like %pK already does, print "00000000" instead. > > This confused people -- the convention is that "(null)" means you tried to > dereference a null pointer as opposed to printing the address. By other words, this avoids regressions when people convert %x to %px. Do I get it right, please? > Signed-off-by: Adam Borowski > --- > lib/vsprintf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/vsprintf.c b/lib/vsprintf.c > index 77ee6ced11b1..d7a708f82559 100644 > --- a/lib/vsprintf.c > +++ b/lib/vsprintf.c > @@ -1849,7 +1849,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, > { > const int default_width = 2 * sizeof(void *); > > - if (!ptr && *fmt != 'K') { > + if (!ptr && *fmt != 'K' && *fmt != 'x') { > /* > * Print (null) with the same width as a pointer so it makes > * tabular output look nice. > -- > 2.15.1 >