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=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 08D9FC04FF3 for ; Mon, 24 May 2021 10:46:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ABA686044F for ; Mon, 24 May 2021 10:46:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ABA686044F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3C3D394006A; Mon, 24 May 2021 06:46:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 37451940055; Mon, 24 May 2021 06:46:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 23C3694006A; Mon, 24 May 2021 06:46:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0235.hostedemail.com [216.40.44.235]) by kanga.kvack.org (Postfix) with ESMTP id E6027940055 for ; Mon, 24 May 2021 06:46:01 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 814045823 for ; Mon, 24 May 2021 10:46:01 +0000 (UTC) X-FDA: 78175794522.19.DE24909 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by imf20.hostedemail.com (Postfix) with ESMTP id 2470F2CA for ; Mon, 24 May 2021 10:45:53 +0000 (UTC) IronPort-SDR: hvWBIR8jwDv9V0JD89uXcvcJwP7IiotiYxB47JWUtLueJmEitARZPInII6i25+vBxJe8dOsju8 Q2Y6jntL88RA== X-IronPort-AV: E=McAfee;i="6200,9189,9993"; a="287474203" X-IronPort-AV: E=Sophos;i="5.82,319,1613462400"; d="scan'208";a="287474203" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2021 03:45:58 -0700 IronPort-SDR: JaGtdzHez43qZfIPsyzl2IBZn+wHzZjpRMNmQCxGH88p8V07+kJYkPWIKDWcZpcPZUG5fF8xe7 LJ1/8TK3dB9Q== X-IronPort-AV: E=Sophos;i="5.82,319,1613462400"; d="scan'208";a="413542294" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2021 03:45:56 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1ll85q-00EIZN-3O; Mon, 24 May 2021 13:45:54 +0300 Date: Mon, 24 May 2021 13:45:54 +0300 From: Andy Shevchenko To: YueHaibing Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] mm/dmapool: use DEVICE_ATTR_RO macro Message-ID: References: <20210523064626.41532-1-yuehaibing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210523064626.41532-1-yuehaibing@huawei.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Rspamd-Queue-Id: 2470F2CA Authentication-Results: imf20.hostedemail.com; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=intel.com (policy=none); spf=none (imf20.hostedemail.com: domain of andriy.shevchenko@linux.intel.com has no SPF policy when checking 192.55.52.43) smtp.mailfrom=andriy.shevchenko@linux.intel.com X-Rspamd-Server: rspam04 X-Stat-Signature: kq6iux5q117e6famn5ciq1iq8wcgkgur X-HE-Tag: 1621853153-517847 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 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 > 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. > @@ -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 > -- With Best Regards, Andy Shevchenko