Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1568371rwb; Wed, 26 Jul 2023 14:55:02 -0700 (PDT) X-Google-Smtp-Source: APBJJlHyAZVW4SVCOCFWQmhN4bHE/klgDCmPjqpLGnCappUE497YrgCaqBArqnpw90uTvqB1hgh6 X-Received: by 2002:a2e:3818:0:b0:2b6:9ebc:daf8 with SMTP id f24-20020a2e3818000000b002b69ebcdaf8mr220123lja.31.1690408502235; Wed, 26 Jul 2023 14:55:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690408502; cv=none; d=google.com; s=arc-20160816; b=ZuLnZDXir1cStWO4ikYI+QfPQb7yKg8FnSqlG28UiIdrrNEozYxjmau41J73vAoVds 6+P2q3/nq/DHVrsjlBWknVyOh8A1i72UJOt5xU9gPK/eWepEork/y+Q0tCx3BgG5lU4q wDivUEgTIsuh5t4XEU5eKTcxm/PdnHsE2EHTjnMbDaKLveUtbMmAJCdS644t6fUZ5037 KW0pvK2EdUL6ywjox6pzbNRhJsQhNizif7Kx9Xv1CaLBcoMphzO/A2zzta/7/PY4MJkd rcV1v+Lhg7z/uRVO3E0YyakmHvoId04WpbpY1mVoTcTxZR5NJexazvDoKcG0E90Bd3Dm TC3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=OZA55SnNbAmvZEmnAh3o1Vey5rx64nx3FOwYsy8KhWI=; fh=qD4DrSQ5QOzHlH5AHCe96AU2x724UFLbtsCwtyVl06M=; b=jh6ZRzbtnWNXc50Hgw09rKglpEUD+OV8WRCNcOtnw+n2K9eYDL5kV2mE+jmvZ/9oQ1 +ynmthlsNIxggVQqHP+DQO/aQ5ppQx5Uw73UOWbXUubaKk5utVCLGIiyOR+YHvdexcPW JzLDsz2MJV2RJ7mccJzr1N/3MawKoKQju4/Rt+NYL1N3yU5gNxeq2uBzqcIXCxgpA3uH lIlnb0xsp02D7yEashZzky6WV7MXqpe6VsKMpMhZWUe6Rv+zM5jOTM8J3ADqBl6cF+G6 502FuQJDGEok0J57wyJcrxle2lKldHe3wWiclTDF9tL/y2xZoPC1s+lKARqNfgBSsaA+ wHTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=uCEDxfvQ; 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=inria.fr Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b15-20020a170906d10f00b009889baa6a24si10444832ejz.1032.2023.07.26.14.54.37; Wed, 26 Jul 2023 14:55:02 -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=@inria.fr header.s=dc header.b=uCEDxfvQ; 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=inria.fr Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229519AbjGZUml (ORCPT + 99 others); Wed, 26 Jul 2023 16:42:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjGZUmj (ORCPT ); Wed, 26 Jul 2023 16:42:39 -0400 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DFE4212F for ; Wed, 26 Jul 2023 13:42:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=OZA55SnNbAmvZEmnAh3o1Vey5rx64nx3FOwYsy8KhWI=; b=uCEDxfvQKI+OZ89DzhponjbY3VXv/Yryua8IgoxBZ9UIaendxM9D4OwW /3hyo6rHOZX3mmqNZc3Ek+iDJgWSyKbZ3hN/Veb92iLre72eWFOy7w/8T VUfzwM7DNGiP4hVKDO4iEuPMWGznDh7sQkb8XLv3Ut6S3bC2a6BuOQk5E Q=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=julia.lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.01,232,1684792800"; d="scan'208";a="119229647" Received: from 231.85.89.92.rev.sfr.net (HELO hadrien) ([92.89.85.231]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2023 22:42:35 +0200 Date: Wed, 26 Jul 2023 22:42:34 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Sean Christopherson cc: Nicolas Palix , linux-kernel@vger.kernel.org, cocci@inria.fr, Paolo Bonzini , Greg Kroah-Hartman Subject: Re: [PATCH v2] Revert "debugfs, coccinelle: check for obsolete DEFINE_SIMPLE_ATTRIBUTE() usage" In-Reply-To: <20230726202920.507756-1-seanjc@google.com> Message-ID: References: <20230726202920.507756-1-seanjc@google.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Wed, 26 Jul 2023, Sean Christopherson wrote: > Remove coccinelle's recommendation to use DEFINE_DEBUGFS_ATTRIBUTE() > instead of DEFINE_SIMPLE_ATTRIBUTE(). Regardless of whether or not the > "significant overhead" incurred by debugfs_create_file() is actually > meaningful, warnings from the script have led to a rash of low-quality > patches that have sowed confusion and consumed maintainer time for little > to no benefit. There have been no less than four attempts to "fix" KVM, > and a quick search on lore shows that KVM is not alone. > > This reverts commit 5103068eaca290f890a30aae70085fac44cecaf6. Applied. > > Link: https://lore.kernel.org/all/87tu2nbnz3.fsf@mpe.ellerman.id.au > Link: https://lore.kernel.org/all/c0b98151-16b6-6d8f-1765-0f7d46682d60@redhat.com > Link: https://lkml.kernel.org/r/20230706072954.4881-1-duminjie%40vivo.com > Link: https://lore.kernel.org/all/Y2FsbufV00jbyF0B@google.com > Link: https://lore.kernel.org/all/Y2ENJJ1YiSg5oHiy@orome > Link: https://lore.kernel.org/all/7560b350e7b23786ce712118a9a504356ff1cca4.camel@kernel.org > Suggested-by: Paolo Bonzini > Acked-by: Greg Kroah-Hartman > Signed-off-by: Sean Christopherson > --- > > v2: Fix a copy+paste goof in the changelog, add Greg's Ack. > > .../api/debugfs/debugfs_simple_attr.cocci | 68 ------------------- > 1 file changed, 68 deletions(-) > delete mode 100644 scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci > > diff --git a/scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci b/scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci > deleted file mode 100644 > index 7c312310547c..000000000000 > --- a/scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci > +++ /dev/null > @@ -1,68 +0,0 @@ > -// SPDX-License-Identifier: GPL-2.0 > -/// Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE > -/// for debugfs files. > -/// > -//# Rationale: DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file() > -//# imposes some significant overhead as compared to > -//# DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe(). > -// > -// Copyright (C): 2016 Nicolai Stange > -// Options: --no-includes > -// > - > -virtual context > -virtual patch > -virtual org > -virtual report > - > -@dsa@ > -declarer name DEFINE_SIMPLE_ATTRIBUTE; > -identifier dsa_fops; > -expression dsa_get, dsa_set, dsa_fmt; > -position p; > -@@ > -DEFINE_SIMPLE_ATTRIBUTE@p(dsa_fops, dsa_get, dsa_set, dsa_fmt); > - > -@dcf@ > -expression name, mode, parent, data; > -identifier dsa.dsa_fops; > -@@ > -debugfs_create_file(name, mode, parent, data, &dsa_fops) > - > - > -@context_dsa depends on context && dcf@ > -declarer name DEFINE_DEBUGFS_ATTRIBUTE; > -identifier dsa.dsa_fops; > -expression dsa.dsa_get, dsa.dsa_set, dsa.dsa_fmt; > -@@ > -* DEFINE_SIMPLE_ATTRIBUTE(dsa_fops, dsa_get, dsa_set, dsa_fmt); > - > - > -@patch_dcf depends on patch expression@ > -expression name, mode, parent, data; > -identifier dsa.dsa_fops; > -@@ > -- debugfs_create_file(name, mode, parent, data, &dsa_fops) > -+ debugfs_create_file_unsafe(name, mode, parent, data, &dsa_fops) > - > -@patch_dsa depends on patch_dcf && patch@ > -identifier dsa.dsa_fops; > -expression dsa.dsa_get, dsa.dsa_set, dsa.dsa_fmt; > -@@ > -- DEFINE_SIMPLE_ATTRIBUTE(dsa_fops, dsa_get, dsa_set, dsa_fmt); > -+ DEFINE_DEBUGFS_ATTRIBUTE(dsa_fops, dsa_get, dsa_set, dsa_fmt); > - > - > -@script:python depends on org && dcf@ > -fops << dsa.dsa_fops; > -p << dsa.p; > -@@ > -msg="%s should be defined with DEFINE_DEBUGFS_ATTRIBUTE" % (fops) > -coccilib.org.print_todo(p[0], msg) > - > -@script:python depends on report && dcf@ > -fops << dsa.dsa_fops; > -p << dsa.p; > -@@ > -msg="WARNING: %s should be defined with DEFINE_DEBUGFS_ATTRIBUTE" % (fops) > -coccilib.report.print_report(p[0], msg) > > base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5 > -- > 2.41.0.487.g6d72f3e995-goog > >