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 BD4EBC636CC for ; Mon, 20 Feb 2023 11:37:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231741AbjBTLhj (ORCPT ); Mon, 20 Feb 2023 06:37:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231522AbjBTLhh (ORCPT ); Mon, 20 Feb 2023 06:37:37 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BCAD1BF8; Mon, 20 Feb 2023 03:37:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=3IfNPTAaPPBd75bAfyJDqCNuYWHBYxJ5ORy+gQ+26fY=; b=CW7ZdEbA+tIwqcxY/TQR5O6sig rjpaOoOEusUGWglCaLQzvzcZbw+vKe89jAwSB6MzYRcA+4hTwAByTSS6CPC8iGVTrY8AU4hdtK+bR 5w2ioUDXinY3NStDBYTj1k9VZeJpblFV3ktovjby+P3F+XXauPYxAdPUjHUG+2oxpsTkQ139Wak2S sgmEc7of2YT9KGIBAaaCaMkd2ZmM0vBU5c02BbB/KR/E1dPchfv0zEqd4BMhTY+MQi9UU3Ob/pCRt wRI2ADxVrFYhXsawmN36WPFDgjsW79iNNjR6jmmguCS6nKN1gTExkUIP4QNbQ2RwL3zwSRy3qxqO8 6hmuiBsw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pU4Tr-00Bgbk-Jf; Mon, 20 Feb 2023 11:37:16 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id F37A63002BF; Mon, 20 Feb 2023 12:37:13 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D68362135FABD; Mon, 20 Feb 2023 12:37:13 +0100 (CET) Date: Mon, 20 Feb 2023 12:37:13 +0100 From: Peter Zijlstra To: Deepak R Varma Cc: Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Gleixner , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Saurabh Singh Sengar , Praveen Kumar Subject: Re: [PATCH] perf/x86/amd/core: Use sysfs_emit() in show() callback function Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 17, 2023 at 10:12:57PM +0530, Deepak R Varma wrote: > Using sprintf/snprintf functions are error prone and suggested to be > replaced by scnprintf/vscnrptintf as outlined in this [1] LWN article. > > A more recent recommendation is to use sysfs_emit() or sysfs_emit_at() > as per Documentation/filesystems/sysfs.rst in show() callback function > when formatting values to be returned to user-space. These helper > functions are PAGE_SIZE aware and wrap a safer call to vscnprintf(). > > [1] https://lwn.net/Articles/69419/ > > Issue identified using the coccinelle device_attr_show.cocci script. This Changelog fails to inform me of what the actual problem is and why the proposed solution is better. As such I cannot form an opinion on the patch and must decline. (Also, I'm not going to chase down random links on the interweb, Changelogs should be self contained)