Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp2040837rdb; Tue, 5 Sep 2023 12:26:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4xjRBojRiTchsb6mEFPhRzbe7+Uo0GR88lTmtcC+RwkXFaXA76huge4ZNwcU1MN5ooGv8 X-Received: by 2002:aa7:904c:0:b0:68a:6e29:65d9 with SMTP id n12-20020aa7904c000000b0068a6e2965d9mr15814619pfo.0.1693941981002; Tue, 05 Sep 2023 12:26:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693941980; cv=none; d=google.com; s=arc-20160816; b=O2iFzzB98E+5F4BXXRVR0dY8YSZziCcTAQmHgNu8CELleS1MGEdIc5ODCubonmMhP2 PJzZ4AD3y6RTuXsND+QvPZ9+7Lo/KLq1YgmlYDvRarRwV/zsh+Q0V7qihDy+LJdkm0DY /RcOOJg4SNVihvWkBQcsXQCJO/UDZ0rbL64bFucCS7rCkoVvB4MgurI3dwOZAIlP63lK Q9twjShd0dmk8c1MeACIZBJEvh2BsjeFVWbnOYRAbeGt9FovL+LOqYVlx4oAhrhNjpwR 4KjKt7b/iClIAyYOPEh/bM0vMTOJpp7pcEZCV/T0lwaqUXwvuiRsOATIckOFKN5EkrHw 7Ogw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=cCD7oDQTTuNv4SdeGzZZogcK2P7LP/9Gy2aHbbIGYoU=; fh=m7og4B5eYCctrLkxc9cSjvs8cj9BT5n6qf42E8IHCpg=; b=a2jwSAbBbQLXF6/qXo0SJtzXQvzNS3Ri2OqPr3c8fogz9Q3SK9VE1CO6Mkz9qmnfov yqP9i2wT7OxrFCnBXTLRsAtpgJMMdGfSuO+Dio00lJQoS9ptqmO3ZOWWEcJ7dN64geOx re5gBuN1ja4jQe9A5/0vJ3V6uuQyp5M29qR6MsB9MCKIVukVTTK1/QsxKX9vRbHSt9IK 9i7kA24JlvMUVB8XbRU6t9XVklbO3Covvy6gpVoHtowGodj9rQvqrWiPnM8mtB9o2phD ECZzSqZgMbixg5LDeO1L/yC9RFv2rwuiULEI2mHK0HXuNPKw7JdD7pGrfj41zt7zVWYA 27jg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t25-20020a639559000000b00564feb7e6a1si9862719pgn.396.2023.09.05.12.26.07; Tue, 05 Sep 2023 12:26:20 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238861AbjIEQmH (ORCPT + 99 others); Tue, 5 Sep 2023 12:42:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343917AbjIEC53 (ORCPT ); Mon, 4 Sep 2023 22:57:29 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C23BECC9; Mon, 4 Sep 2023 19:57:25 -0700 (PDT) Received: from dggpemm500012.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4RfqpP0YmVzMl5w; Tue, 5 Sep 2023 10:54:05 +0800 (CST) Received: from localhost.localdomain (10.50.163.32) by dggpemm500012.china.huawei.com (7.185.36.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Tue, 5 Sep 2023 10:57:23 +0800 From: Xingui Yang To: , , , CC: , , , , , , , , , , , , , , , , Subject: [PATCH v6 0/3] Add helper macro DEFINE_SHOW_STORE_ATTRIBUTE() at seq_file.c Date: Tue, 5 Sep 2023 02:48:32 +0000 Message-ID: <20230905024835.43219-1-yangxingui@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.50.163.32] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500012.china.huawei.com (7.185.36.89) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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 We already own DEFINE_SHOW_ATTRIBUTE() helper macro for defining attribute for read-only file, but we found many of drivers also want a helper macro for read-write file too. So we add this helper macro to reduce duplicated code. Changes from v5: - Undelete the unused macros in qla_dfs.c and rewrite them using reference to the new macro on Andy's suggestion. - Adjust some descriptions in commit based on Andy's suggestion. Changes from v4: - Reduce the scope to scsi subsystem based on Andy's suggestion. - Remove unused macros in qla_dfs.c - Adjust some descriptions in commit. Changes from v3: - Add AI Viro's comment to v1->v2's revision description. - Fixed a spelling mistakes of "marco" to "macro". Changes from v2: - Fixed some spelling mistakes in commit. - Revision description are added for easy tracing. Changes from v1: - Rename DEFINE_STORE_ATTRIBUTE() to DEFINE_SHOW_STORE_ATTRIBUTE(). - AI Viro points out that he doesn't like the definition of macros like DEFINE_SHOW_ATTRIBUTE. Luo Jiaxing (3): seq_file: Add helper macro to define attribute for rw file scsi: hisi_sas: Use DEFINE_SHOW_STORE_ATTRIBUTE() helper for debugfs scsi: qla2xxx: Use DEFINE_SHOW_STORE_ATTRIBUTE() helper for debugfs drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 137 ++----------------------- drivers/scsi/qla2xxx/qla_dfs.c | 59 ++--------- include/linux/seq_file.h | 15 +++ 3 files changed, 31 insertions(+), 180 deletions(-) -- 2.17.1