Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp545498pxu; Fri, 23 Oct 2020 07:34:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyURG8AInKTHQarZ2+YaUf5xhgdDcMHWQehSIjApGVuQm69CBTwnhWGMzOHuamuhEsLbGk X-Received: by 2002:a17:906:354c:: with SMTP id s12mr2289909eja.263.1603463653631; Fri, 23 Oct 2020 07:34:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603463653; cv=none; d=google.com; s=arc-20160816; b=oenRhJGtVesmqTL1/1IhORGSo6dxF/KKBk0abCVwemH5+dhMOcm2B6ylhhmUVXkotL ai25nx5v+LLEOdTAF+n/3fhPicAfqWjPw1agp1R4FrSI/Ln0WLGVOrvCUT2ZCei0BZ0A aI7yR01TigwN4zyyIRZZgit5rE6T5oySqPVKUbBIBhh1oqAiHjVGDsxe7Dr5EJbljyTs JvSqloG/WFxU8qH5jXFC6WCl8YnB52yKN+HzGPV+8Bd0AOaFApEq5xEILtoUiWhIO3y8 Mn2MW8bnHQuSKrOf6NJzNxAGh9mNxhm3nJxxxaSzQQ8QdnmypIux77DLZVPwAtIZP/wI vpWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=PK5BlooAmPtK6GEv/g6DUPo4TwaMbFYCKrOIGNjg3kg=; b=VDtgIhS2pQFgg/ZugGpEZSFGCmGVRo+3y5ilkyg0Fc2x7I0/a1mysEsnJiQa582XKp WHDpoCbY++zcso4eS7IlgI7a72AjsWGCVYQnFSbcoSyzjI/6bFB2fJgU8b+zANT0Wj3n vtbRk4D0qIO1LkT/c2gX/sTtioT2Ln+OYB88QJQi8wmSfKW46agUlnbshTCUYjDkvrXm f1aheimfkV4A6xH/tV1v1/hntfIXp+D4K3FSgXBzkc0ksEu6vEuaosWoXkH3Bt+oV/eC xXeDxfY9bFDKwR8YY2L9sysIbu1iPT6hsbSD6W013gP45rSGmU9OXevS3IBGVosCOq+7 HzUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn22si1019228edb.603.2020.10.23.07.33.51; Fri, 23 Oct 2020 07:34:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S372730AbgJWG3P (ORCPT + 99 others); Fri, 23 Oct 2020 02:29:15 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:33050 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S369627AbgJWG3P (ORCPT ); Fri, 23 Oct 2020 02:29:15 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id E0EC4BBF3C1F6B357141; Fri, 23 Oct 2020 14:29:12 +0800 (CST) Received: from [127.0.0.1] (10.57.22.126) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.487.0; Fri, 23 Oct 2020 14:29:06 +0800 Subject: Re: [PATCH v1 0/5] Introduce a new helper marco DEFINE_STORE_ATTRIBUTE at seq_file.c To: Al Viro CC: , , , , , , , , , , , , , References: <1603355997-32350-1-git-send-email-luojiaxing@huawei.com> <20201022122858.GT3576660@ZenIV.linux.org.uk> From: luojiaxing Message-ID: <7003f142-5d53-1285-c6cd-a8e8d9c076b7@huawei.com> Date: Fri, 23 Oct 2020 14:29:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20201022122858.GT3576660@ZenIV.linux.org.uk> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.57.22.126] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi On 2020/10/22 20:28, Al Viro wrote: > On Thu, Oct 22, 2020 at 04:39:52PM +0800, Luo Jiaxing wrote: >> 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 marco for >> read-write file too. > DEFINE_SHOW_ATTRIBUTE is a bloody bad idea; let's not replicate the garbage > any further. If you want templates - C++ is over that way... I am sorry but would you mind to explain it in more detail that why DEFINE_SHOW_ATTRIBUTE is a bad idea? I found that DEFINE_SHOW_ATTRIBUTE is convenient and avoids a lot of duplicate code When add some debugfs file for DFX. Thanks Jiaxing > > . >