Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5347428rwb; Wed, 21 Sep 2022 06:41:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7+egYl2Q5eqqgBvr6qJSPTxF+NQGnM0pE7HEVodWOtpc4J+SWiWSDHKVs4j7IuCHRhZAMA X-Received: by 2002:a17:906:ef90:b0:77f:8f0d:e925 with SMTP id ze16-20020a170906ef9000b0077f8f0de925mr20518486ejb.622.1663767669839; Wed, 21 Sep 2022 06:41:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663767669; cv=none; d=google.com; s=arc-20160816; b=eYYEqENF80libXQWG/sSN7ELhRN4Lh6Mhuq0MU6R6gWIn7Y3zfRAKt5RskXrQDYzj8 dYev/HXcBurGazByHa4GY/LxgyQ+h620b9JnLbHhrUbzic0tyKD+LBZevboZA2cLb+bz SSIq/kQgvJIsgVInyU7z3MH0g0Sw5qeMxdUfBvmWhXjvLxkG16FJSiijoOAYQLBe2h/3 bV5nkqhFLthhtPq3oL0brjj7zGi+FOESg2LIQdnQxlmeZ/ybvC+Sx6f6GYVzlS+JNmXc 7Jysxgyh6b1mVbR/L1ULHYNkO93YKpGjLJjncvzw9ycLFhOZguI8MAMl8CWNJP7PlLGt Moww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=SNOx7u/YQMIaTFhVzek1ee94itBFfBqVi5hVjzogOrM=; b=rC13y6zQsw2G4wpurLA/QFTF7LZyUdPxnEuNgHsIFz1BNWbljCbYyUq/pUZUsvesN+ 9jdsovr6U87p/KjB8XqVPWaNAgDPmMNkC1zBivmfgVvwfRL0WdnmcnqWTjpQbVLRD1t9 tVeATlke3WBvySWhfDMLtJH5DdfdXXrXCpxiEWTP4D6TYBW/d3POi3fvT+fr1pSpn68J +5UtOlMavp1CrHC9iRf1W2xI6oJ0DBEPTBc9stM42+08w+dtvjfrw+4anKX/gnZK/MRO PW1YgsacC6qazh2jI3SA7SicO2iwB5t/IHotfnFBV+9+UAj6H5jj2HNgAU1nDF//m/Bh omtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=w96BX+RZ; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l15-20020a1709062a8f00b0073d6c94fc3dsi2115403eje.162.2022.09.21.06.40.42; Wed, 21 Sep 2022 06:41:09 -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=@suse.cz header.s=susede2_rsa header.b=w96BX+RZ; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229803AbiIUNBO (ORCPT + 99 others); Wed, 21 Sep 2022 09:01:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229771AbiIUNBL (ORCPT ); Wed, 21 Sep 2022 09:01:11 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF9C229C96; Wed, 21 Sep 2022 06:01:08 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6B4F61F88F; Wed, 21 Sep 2022 13:01:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1663765267; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SNOx7u/YQMIaTFhVzek1ee94itBFfBqVi5hVjzogOrM=; b=w96BX+RZ4LI2I1gSSCNz1WzUxOSmT/ftdP87PZsC/lhCyeX+JSmn5MNEKJCk6rxCZaZJ5i q4qup0ww94M49Z18AIlv9NnY3fKzaQbk9R4ra4EbELxgDy2tfUTO/faed177fpkYWa+at3 1GUaKRbgLJn21ONDnXP5UmldQRL8dbQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1663765267; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SNOx7u/YQMIaTFhVzek1ee94itBFfBqVi5hVjzogOrM=; b=/bDdRRT7yb0B3YNd+chIJllTtWIpxxXPvL9XfsQSP49oD5NrC+KdNEvE/CGcRivMRsMFLK ECPigt2cFFDZJeAw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3ECF613A89; Wed, 21 Sep 2022 13:01:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id bCdrDhMLK2PYLwAAMHmgww (envelope-from ); Wed, 21 Sep 2022 13:01:07 +0000 Date: Wed, 21 Sep 2022 14:55:35 +0200 From: David Sterba To: Ingo Molnar Cc: Peter Zijlstra , linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org, Jules Irenge , x86@kernel.org Subject: Re: [tip: perf/core] perf/core: Convert snprintf() to scnprintf() Message-ID: <20220921125535.GF32411@twin.jikos.cz> Reply-To: dsterba@suse.cz References: <166374773592.401.16831946846027095231.tip-bot2@tip-bot2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no 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 Wed, Sep 21, 2022 at 12:44:35PM +0200, Ingo Molnar wrote: > > * Peter Zijlstra wrote: > > > On Wed, Sep 21, 2022 at 08:08:55AM -0000, tip-bot2 for Jules Irenge wrote: > > > The following commit has been merged into the perf/core branch of tip: > > > > > > Commit-ID: 678739d622ae7b75b62d550858b6bf104c43e2df > > > Gitweb: https://git.kernel.org/tip/678739d622ae7b75b62d550858b6bf104c43e2df > > > Author: Jules Irenge > > > AuthorDate: Sun, 18 Sep 2022 00:41:08 +01:00 > > > Committer: Ingo Molnar > > > CommitterDate: Wed, 21 Sep 2022 10:01:20 +02:00 > > > > > > perf/core: Convert snprintf() to scnprintf() > > > > > > Coccinelle reports a warning: > > > > > > WARNING: use scnprintf or sprintf > > > > > > Adding to that, there has also been some slow migration from snprintf to scnprintf. > > > > > > This LWN article explains the rationale for this change: > > > > > > https: //lwn.net/Articles/69419/ > > > > > > No change in behavior. > > > > > > [ mingo: Improved the changelog. ] > > > > And yet, at this point I still have no clue what's wrong with > > snprintf(). So not much improvement :/ > > I've added this to the changelog: > > perf/core: Convert snprintf() to scnprintf() I'm not sure if it would apply in this case as it's for a device attribute, but there's another helper sysfs_emit that does the safe print to string and one does not have to care which flavor of s*printf it is. We had patches in btrfs converting from snprintf to scnprintf and the latest one is sysfs_emit which is convenient to use but assumes the PAGE_SIZE of the buffer.