Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1071265rwb; Tue, 27 Sep 2022 08:05:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5n/C99Ek2XK33cPLxR1C4EBA83SaG/GnsQdRzPPxDe4Cdd7wczAzwThhW/eJL7CTjAPRC3 X-Received: by 2002:a17:906:ef90:b0:77c:7227:705 with SMTP id ze16-20020a170906ef9000b0077c72270705mr22428774ejb.565.1664291124827; Tue, 27 Sep 2022 08:05:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664291124; cv=none; d=google.com; s=arc-20160816; b=XK3ELDM8OdMgzgYzHbu/RQ8HuRWzkYCMUYYvxhb1fVGllQSNHxIT1+giW8HnMGPW5e /A+9nk1qqDSJO171VexqV2tl34I4EmhIahEIFRog1HrpFRSaoojH+MX04Zbn16OhJwNG Z4IhoDSROravZU4ts1JjTeoaSa7P6JpSTOzN6A8qSwAxAxOJKtEp0v7l5IsvK2N78wBF /8D/rCvGNbfngOg4KuuaYPxGmcScyVJ6VIEW3pGBUg9E56OSQQqF+AAzID+NUaa5SiF6 oWBgHT7pJkog8/E9I1LgZfT55kjpxmfoM/dQ02e9Y1kAOOHQ1JMbgdJsBYypjjUplvyL TnXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ISh3athQKV9HTh69VEu5ssiZETlL0OBO40VvatwdqpA=; b=kDlkaE1xkJphgealXflOIr2zMv4lY38D7UkakesO7vhkGnry2YZpCt7wQB5aqtmINz IRyZtiZOmUx1T15SDkWA6ehm8Zx1a7FQQf9FxPLUC5MUbuYtrUE895i09h6/dLo8fOyK gNgdgLJjCTcYH5F0LCVfymrM8ZI3y7V4i6oEVUvMr3fMD+KC+QYrvMh2Jf/pI9DHpa0O RtSz92N1SPvE9PYIUwkgsbvcYcZtMSXPk/+k2ODcN1P3RFlNDym0g6/7nILPiPl839qv gIARCUAPFHjlPmgRdCS8hbaFamb/Gh/VvV4m8MIbMvJlHjypILmcM/hgYUXaRZ6NqBHK 0Spg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uRHFUkWc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sa42-20020a1709076d2a00b00780261908d5si1826016ejc.16.2022.09.27.08.04.56; Tue, 27 Sep 2022 08:05:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uRHFUkWc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231294AbiI0PA4 (ORCPT + 99 others); Tue, 27 Sep 2022 11:00:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231838AbiI0PAe (ORCPT ); Tue, 27 Sep 2022 11:00:34 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BDD53E772; Tue, 27 Sep 2022 08:00:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id C2ECCCE19C1; Tue, 27 Sep 2022 15:00:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89289C433D6; Tue, 27 Sep 2022 15:00:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664290830; bh=81ZggzcRDYREEiyZAFfZf2iNyEU4c2S22a/8ksdHrNA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uRHFUkWcjtW1f8LNpABWTRojamUqeeFWLivk6u2qJM62I9cJd+jLVzW4WorsvDMKL Xn7K85RmCPx/aKZKXtdJx/CkiaOgcFYMsjErIJr1YTpZpOmN5SBMJhMbByOubDkSPr xw6YpD8uBOotEou4j6qEveRxrbsUgXjmmukBth14= Date: Tue, 27 Sep 2022 17:00:27 +0200 From: Greg Kroah-Hartman To: Miguel Ojeda Cc: Linus Torvalds , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, patches@lists.linux.dev, Jarkko Sakkinen , Gary Guo , Kees Cook , Petr Mladek , Alex Gaynor , Wedson Almeida Filho , Steven Rostedt , Sergey Senozhatsky , Andy Shevchenko , Rasmus Villemoes , Jonathan Corbet , linux-doc@vger.kernel.org Subject: Re: [PATCH v10 14/27] vsprintf: add new `%pA` format specifier Message-ID: References: <20220927131518.30000-1-ojeda@kernel.org> <20220927131518.30000-15-ojeda@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220927131518.30000-15-ojeda@kernel.org> X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 27, 2022 at 03:14:45PM +0200, Miguel Ojeda wrote: > From: Gary Guo > > This patch adds a format specifier `%pA` to `vsprintf` which formats > a pointer as `core::fmt::Arguments`. Doing so allows us to directly > format to the internal buffer of `printf`, so we do not have to use > a temporary buffer on the stack to pre-assemble the message on > the Rust side. > > This specifier is intended only to be used from Rust and not for C, so > `checkpatch.pl` is intentionally unchanged to catch any misuse. > > Reviewed-by: Kees Cook > Acked-by: Petr Mladek > Co-developed-by: Alex Gaynor > Signed-off-by: Alex Gaynor > Co-developed-by: Wedson Almeida Filho > Signed-off-by: Wedson Almeida Filho > Signed-off-by: Gary Guo > Co-developed-by: Miguel Ojeda > Signed-off-by: Miguel Ojeda > --- > Documentation/core-api/printk-formats.rst | 10 ++++++++++ > lib/vsprintf.c | 13 +++++++++++++ > 2 files changed, 23 insertions(+) Reviewed-by: Greg Kroah-Hartman