Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp1399796rdb; Mon, 4 Sep 2023 12:33:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHOHMgo0/bo/WVUolvs57yshFrWZf0JtzL3LaVJjHuhcKJT4PUpiHoUE8mPzGK9icIH43wl X-Received: by 2002:a05:6a00:1ac6:b0:68a:5395:7a9c with SMTP id f6-20020a056a001ac600b0068a53957a9cmr9669222pfv.9.1693856014641; Mon, 04 Sep 2023 12:33:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693856014; cv=none; d=google.com; s=arc-20160816; b=T/obgscJy3tgddh61wFxNDSpOpR5c6Mdwktq/QXYa671QjRWAR22JnSFTYs4VEbkQ6 8Gw5E86gG7CWmoaWLORfAtjjp19pEmWhW24XfCSQJ8FTf7B+57JtQrTVSLvginiIX1Zf 29WOR9kH7uf1SrrbcMJss+SKLKXxwMnU/yTNLsYkE9zlUIkAcnFBuFImn9wTFxvskGub p3eVVoRoipNwZsR3g70ZGSFpx+pur5Ycneny81cSRLc9IKLjT1Irdt0xPdd3Wg/CFUx1 VkmdN/CAWM+Dwr0V8vFQMMQcfGNhpzx8Cj8cyfOR+6SiF7J5kutXMCUDryhJqEcmrM77 tvkA== 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=31DbRTtPtrqc8iyQDZoomEbd3XDuFQCXjLRwyxVAufU=; fh=m7og4B5eYCctrLkxc9cSjvs8cj9BT5n6qf42E8IHCpg=; b=h2PXfyQd4swCtBTdnLx2MTADb75GRTFmbsEKYgtOi8NprBqLxLvx1cnNqsE4S58Wfu nDAvB+RVDMZGEZaBixjfMge8db338oNAgcmJyaMZNnK8x6eyrOkOGEZN3bLykSh+Ivw0 g7RnuUIC9oKCG6U66PUHRoPlAWdqNJpIKiPZGOY9kUNbDTyYTidDIZU2RLgvIwEcCKkq 4A3at+XeBrLvq9XS3G8uJFLG2eAisFtcEybO3QOJTmHOxQYaGxMfEWK0Fy+JvD7kzbcA /ZPwdJw4SlkGc288mx61vf1M0ALi5f0A1539E7KmlR69noQUjlOFP9kxHc/KI4nM3YIG CpAQ== 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 fc32-20020a056a002e2000b0068a2f6b8425si8297576pfb.298.2023.09.04.12.33.16; Mon, 04 Sep 2023 12:33:34 -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 S1352609AbjIDI46 (ORCPT + 99 others); Mon, 4 Sep 2023 04:56:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234157AbjIDI45 (ORCPT ); Mon, 4 Sep 2023 04:56:57 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0020512E; Mon, 4 Sep 2023 01:56:53 -0700 (PDT) Received: from dggpemm500012.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RfMsQ25bLzrSRf; Mon, 4 Sep 2023 16:55:06 +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; Mon, 4 Sep 2023 16:56:51 +0800 From: Xingui Yang To: , , , CC: , , , , , , , , , , , , , , , , Subject: [PATCH v5 0/3] Add helper macro DEFINE_SHOW_STORE_ATTRIBUTE at seq_file.c Date: Mon, 4 Sep 2023 08:48:01 +0000 Message-ID: <20230904084804.39564-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,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, 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 duplicate code. 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 | 113 +------------------- include/linux/seq_file.h | 15 +++ 3 files changed, 26 insertions(+), 239 deletions(-) -- 2.17.1