Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3334941pxj; Mon, 24 May 2021 04:28:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVDoR7qj1TGnJkHYH6Pus0o8Z8BOwoKNKNe1Fv/eZpAi6ifXVJdWI11ojrEQm4P42KHwJH X-Received: by 2002:aa7:de19:: with SMTP id h25mr25475318edv.84.1621855738009; Mon, 24 May 2021 04:28:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621855738; cv=none; d=google.com; s=arc-20160816; b=xOG3LCh3roq51r2PeD6wUmWGzxgnLwWyCV4oTbL/x+KycPQszfc1G6UtF+BdlkYGQf CCutGhKA/WKYp4JaM7Tw36Tq3pDa7Iui/qvHMcJqQuJeYBcsova86hQ6GBxQd5Ygwi6l cRO02+ubo41fVH02TYbyZLmf5ucQNVsRIxKp9QnxP1h9fHlcBXarxhb+nlwgxPM8ze37 OgtwL052xZpUi576AszZB7n7w129B2T5qBj4kIlqV+DjYN2Wm/hwCy+WqFRQrbBQ3vOH 8dEWWPTTLStfS2XrRm5XAQQ63cTlK92EWB7hPM7t4hRKiJ3vkpyd3bF9aSw1toR8skBu ONVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=N2TdEom2dc9GxYHWvoLmDdz+K3RVU7fWEf09zYj6YBI=; b=qC+Y793H/hVxR0MrCEFxK2s7DZF/Drti904BJld5lYm3cznu5LYBqN3JD34YRD9RR6 s1P8e5BDwrk0DhtTCRRZcUe8qfnW8oH5W+Ycu6+2l3pwlyWd4/1xbKfzOau+3bXuV6p1 Ng3Bk46mrTKEnynOqA4uHeAt0L1RVjLvcnmRHDsZFJ+SFPlIE0/n4Kn1mDgwsZXwSS6r oXvflSFOdUu/ZaA61/n1Sq3ThbtMjoqIWkJChlgoyiwxFuuxDzJ81SdPCTy5C0iQZuG9 rWpiRSrbXp6tdrEDaJvgKW2fe1jtqv02gmxsu8VMU98tR2ey5ARIFMMlHf7sMH3eARFj QRtw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i19si10542311edc.501.2021.05.24.04.28.35; Mon, 24 May 2021 04:28:58 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232574AbhEXL1N (ORCPT + 99 others); Mon, 24 May 2021 07:27:13 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3643 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232517AbhEXL07 (ORCPT ); Mon, 24 May 2021 07:26:59 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> >