From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBF79C04FF3 for ; Mon, 24 May 2021 11:25:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 50396610FA for ; Mon, 24 May 2021 11:25:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 50396610FA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A9C786B0202; Mon, 24 May 2021 07:25:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A4C0E6B0203; Mon, 24 May 2021 07:25:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8ED2A6B0204; Mon, 24 May 2021 07:25:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0189.hostedemail.com [216.40.44.189]) by kanga.kvack.org (Postfix) with ESMTP id 5F1656B0202 for ; Mon, 24 May 2021 07:25:37 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 02AB28249980 for ; Mon, 24 May 2021 11:25:37 +0000 (UTC) X-FDA: 78175894314.17.B75760C Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf15.hostedemail.com (Postfix) with ESMTP id D12E1A0001C5 for ; Mon, 24 May 2021 11:25:32 +0000 (UTC) Received: from dggems704-chm.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FpZYH2MGTzNytN; Mon, 24 May 2021 19:21:55 +0800 (CST) Received: from dggema769-chm.china.huawei.com (10.1.198.211) by dggems704-chm.china.huawei.com (10.3.19.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Mon, 24 May 2021 19:25:25 +0800 Received: from [10.174.179.215] (10.174.179.215) by dggema769-chm.china.huawei.com (10.1.198.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Mon, 24 May 2021 19:25:25 +0800 Subject: Re: [PATCH -next] mm/dmapool: use DEVICE_ATTR_RO macro To: Andy Shevchenko CC: , , References: <20210523064626.41532-1-yuehaibing@huawei.com> From: YueHaibing Message-ID: <3c79a2e6-4560-b417-9a11-b5baa5f28a25@huawei.com> Date: Mon, 24 May 2021 19:25:24 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.215] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggema769-chm.china.huawei.com (10.1.198.211) X-CFilter-Loop: Reflected Authentication-Results: imf15.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=huawei.com; spf=pass (imf15.hostedemail.com: domain of yuehaibing@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=yuehaibing@huawei.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: D12E1A0001C5 X-Stat-Signature: j911rssairh4esauwaabi5zbm74azx3t X-HE-Tag: 1621855532-462148 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 2021/5/24 18:45, Andy Shevchenko wrote: > On Sun, May 23, 2021 at 02:46:26PM +0800, YueHaibing wrote: >> Use DEVICE_ATTR_RO helper instead of plain DEVICE_ATTR, >> which makes the code a bit shorter and easier to read. > > DEVICE_ATTR_RO() > DEVICE_ATTR() > > After addressing above and below, > Reviewed-by: Andy Shevchenko Ok, will send v2. > >> Signed-off-by: YueHaibing >> --- >> mm/dmapool.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/mm/dmapool.c b/mm/dmapool.c >> index 16483f86360e..62083ef04878 100644 >> --- a/mm/dmapool.c >> +++ b/mm/dmapool.c >> @@ -62,8 +62,8 @@ struct dma_page { /* cacheable header for 'allocation' bytes */ >> static DEFINE_MUTEX(pools_lock); >> static DEFINE_MUTEX(pools_reg_lock); >> >> -static ssize_t >> -show_pools(struct device *dev, struct device_attribute *attr, char *buf) >> +static ssize_t pools_show(struct device *dev, >> + struct device_attribute *attr, char *buf) >> { >> unsigned temp; >> unsigned size; > > Unrelated change. There change show_pools() to pools_show() > >> @@ -103,7 +103,7 @@ show_pools(struct device *dev, struct device_attribute *attr, char *buf) >> return PAGE_SIZE - size; >> } >> >> -static DEVICE_ATTR(pools, 0444, show_pools, NULL); >> +static DEVICE_ATTR_RO(pools); >> >> /** >> * dma_pool_create - Creates a pool of consistent memory blocks, for dma. >> -- >> 2.17.1 >> >