From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7964FC32771 for ; Wed, 28 Sep 2022 10:10:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230169AbiI1KKC (ORCPT ); Wed, 28 Sep 2022 06:10:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232140AbiI1KKA (ORCPT ); Wed, 28 Sep 2022 06:10:00 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09BA89080F for ; Wed, 28 Sep 2022 03:09:58 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id d11so11373764pll.8 for ; Wed, 28 Sep 2022 03:09:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=duP8xfDehjxwwRzMlO+xIkuofiVIyjCnJ39OqEBZnvg=; b=lib6B2mMxl5NxnINW0OzG0zC66Z3LCxS8m+inz3s790XzYWfBXOcjpz79BlYtXU+zC hfchdOgWGjEq9QbwDqw2agsx5TcvvzkUpGqDh/OymxIaA0trvTvjbAlv2j422Heo/mhf CHZYlO8o6iKNhyTtuCByT1TiWNNIHXygpcP6s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=duP8xfDehjxwwRzMlO+xIkuofiVIyjCnJ39OqEBZnvg=; b=GJKgXBST3XBLXeFp+09aM1Urg8qP3lm1sDgnVAtY7gEfx2MyvculrYFt/o07VYIK62 HZB/vnx0MD39UWkmxiEB1c/QJOw04xwKI52qivMG1VxiJm3OIGfaBrC9GlnPAy55pm/F YUc5BBCuEyI7UwNQwpA6bRTVFBrhjn3nfgZ38idNt8RnDPaA7nm9OPwGdEe9Om1585ht 2Ul8nr0uQl6CbVJ1QEBHqP5pql+sz14HjiccAiqYb/hR4L/pSVZ/cC5Dci2O3lklNxou goEimxZQvkT416yQaDkvVKT3uWNcnYkuOboBPZr8VWYxSzdPCpuGIsinuFyobnSeGtJ1 L5cw== X-Gm-Message-State: ACrzQf0gBLMF2WoPitj/KigJccEvw+jFdG+6AUKPVJN8eJbisT5t4GV4 hp3erkaG3x7l28fwdDL0n1Ep9vFHVDZVTQ== X-Google-Smtp-Source: AMsMyM4xOfc8HLa6MnTzpmJZID7CRRxzXzSmbwQ3uH59f74/DtPFaDC2Z73NATAqWDt7D8COPRC4yg== X-Received: by 2002:a17:902:bd8e:b0:178:25ab:56cc with SMTP id q14-20020a170902bd8e00b0017825ab56ccmr31062254pls.86.1664359797576; Wed, 28 Sep 2022 03:09:57 -0700 (PDT) Received: from google.com ([240f:75:7537:3187:d8e5:5ceb:cc0c:18ad]) by smtp.gmail.com with ESMTPSA id u16-20020a170902e5d000b00172f6726d8esm3285144plf.277.2022.09.28.03.09.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 03:09:57 -0700 (PDT) Date: Wed, 28 Sep 2022 19:09:50 +0900 From: Sergey Senozhatsky To: Miguel Ojeda Cc: Linus Torvalds , Greg Kroah-Hartman , 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> Precedence: bulk List-ID: X-Mailing-List: rust-for-linux@vger.kernel.org On (22/09/27 15:14), Miguel Ojeda wrote: > 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 Reviewed-by: Sergey Senozhatsky