Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3980522imu; Fri, 30 Nov 2018 09:00:50 -0800 (PST) X-Google-Smtp-Source: AFSGD/VPHLLh6HYhHco21i+EmnAxYvDOdE0Dk1mUHy16b4Z/9lCSvVmVJEFWRYf7WatMSekgDCzy X-Received: by 2002:a17:902:8687:: with SMTP id g7mr6347831plo.96.1543597250642; Fri, 30 Nov 2018 09:00:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543597250; cv=none; d=google.com; s=arc-20160816; b=bAdvhpfazIzJFLoCgztSQk3yzvVx/tozKRgdR/wbfGTLzP1i69XLi4cTRx85GKxWlQ 8UPIdllIXDd7Ktg5hqp1igzn1eWdiWqQmgBz9rD4XKGrRDN5t/QDFwiHKY+iXDE+yK2Q U9NXDrk0cDkmE70XXbOPhz1dx1jNbBDWRxR0XnbNAWRix+5KbcnydM0Dg68e4hDqkIJM 7AVMdX8cWsumY/tnuXZU3pH1GOEka8ZFvkkKNaQ9w+/Vx9Fd054IQ4uS4MgATaDKjxwt 7UFup/8+/S9eZAMr0cd9sp04i5a3shAGs3nU5RUWCY+T1CVP0/S6TdXtQ4peOlsL08cJ Z5Cw== 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; bh=Gg8aAxg42x1z3Am0j+s8zNMGbvSVAAkAIaIs/vH/UgU=; b=XLqY9VW4dexaLYGAnOwuCvPO0e8gkrAhugz+iLixZ/0piY8vHEYV7OKgfltcwaTxCh T6OT4W6r8bohLb084QwOPovowsZrRCS/La+9u1rh3b861yx+LeKp2IZ0PgpI85b1vCg7 ywvXdloVERYDbY6PhQgtXJdoTU0GTSnQD2rDZ9T7MiftewWYYKcxwBXHMt/GjctRSRt4 cnbrabmtU+RcBfTEwHhZQ51uFGkGZ/5jlAw4ZqphcurQj884C0bJPECs4C5LN2n/WB34 9Mwip2uJniZqY56xUTcELxODgsFSblB/UESivtPvZLWrJNfdQfwuQMkIs3hKt1uvGSvq s3AQ== 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 g184si5768254pfb.288.2018.11.30.09.00.32; Fri, 30 Nov 2018 09:00: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 S1727679AbeLAEIV (ORCPT + 99 others); Fri, 30 Nov 2018 23:08:21 -0500 Received: from mx2.suse.de ([195.135.220.15]:37198 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726732AbeLAEIV (ORCPT ); Fri, 30 Nov 2018 23:08:21 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B728DB0B7; Fri, 30 Nov 2018 16:58:24 +0000 (UTC) Date: Fri, 30 Nov 2018 17:58:23 +0100 From: Petr Mladek To: Joe Perches Cc: Sergey Senozhatsky , Linus Torvalds , LKML , Steven Rostedt Subject: Re: RFC: script to convert vsprintf uses of %pf to %ps and %pF to %pS Message-ID: <20181130165823.pmqw6l4fldfmwd2a@pathway.suse.cz> References: <8eb7769cb8550e82105b71ba67fd603394e23b1e.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8eb7769cb8550e82105b71ba67fd603394e23b1e.camel@perches.com> 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 On Sun 2018-11-25 01:13:51, Joe Perches wrote: > commit 04b8eb7a4ccd ("symbol lookup: introduce dereference_symbol_descriptor()}" > > deprecated vsprintf extension %pf and %pF. > > so a script to convert all the %pf uses to %ps and %pF uses to %pS > could be useful. > > There are a few files that appear should not be converted. > > $ git grep -w --name-only -i '%pf'| \ > grep -vP '^(?:Documentation|tools|include/linux/freezer.h)'| \ > xargs sed -i -e 's/%pf/%ps/g' -e 's/%pF/%pS/g' > > If that script above is run, it leaves the following patch > to be applied: > diff --git a/lib/vsprintf.c b/lib/vsprintf.c > index 37a54a6dd594..393002bf5298 100644 > --- a/lib/vsprintf.c > +++ b/lib/vsprintf.c > @@ -1872,8 +1870,6 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, > } > > switch (*fmt) { > - case 'F': > - case 'f': Please, keep handling these modifiers so that they do not get reused anytime soon. The pointer modifiers are evil. Any misuse can easily lead to a crash. Any mistakes with upstreaming 3rd party patches or backporting stable fixes would be hard to notice. Well, it is perfectly fine to just explicitly fallback to the default %p behavior. I mean something like: case 'F': case 'f': /* Replaced by %ps and %pS and removed in 4.21 */ break; Best Regards, Petr