Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3307254pxj; Mon, 24 May 2021 03:47:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdQWCEbsvAKSDNocNzZ/XLPpakshfy8/gBYh8N8aMf9IG+Dxp9c9s9yw7xlgHl4CoaOzGR X-Received: by 2002:a92:db07:: with SMTP id b7mr14016007iln.282.1621853243882; Mon, 24 May 2021 03:47:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621853243; cv=none; d=google.com; s=arc-20160816; b=bUy0Xj1wOynZo0NFZFW2JgscDgTpfdEPvoNXqC7hwaW6AD8WTvJ0QbfhVkh0igTQGG 68qg2C1tUTDXCEFm9sGXAZCIYcZYdnKJgF07xGya2I04ROzx71jcJsjt4lp9vuOrh2Oj g6gQaii3G+GNgiUGnGBOeD0sTdSjT6cz9lLYviR82e7El/CRkKw7YkxiwOe3vt1gbWcx VzZKQay/u6MK0vWEzHX55gPtp7h85bfs6mVsJzVGI4hChpuWFo4KtERTmr03V82kaCcO LR/daodIExPaPA0kd1qGA+f1eh7Y9dkgxy85RJdMddaARKRxKUh/NL7nhdfTzkDx3zYY IwBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=XmUfGC+pzce5MncFnjjlf/qpWRJIVci947Iet3AC3+M=; b=B5pnjY4dXmFgd00eaT/xt64KO9fFravznXcTtTqAgYGTPxVZXJZl4+FqJ1mQ4dwdai DoXIAYqHytXIeTUQze4VP19bEJG5RTrXjBrlDW20C8TxD+aaRbCwseBNMnNKLRjPf1LT 8o7TsdGJ1RAgnI8M0VwXmruKWkswiiKEOb6JB9U/9y0mo0z5nMlJaqexMceQr0r5cri4 7lk6WT+lhDSumYFUc6vWMPbd4+3GhLtlPF0d6ttWUSay1sfy3thuTrglyTzNTZ+YIjyJ IaF05DJOMgyVFPFEVlOQOZw4aAKakIyfdPvYh2n1TCg05knJZfhVH0Fmt9LfG1AjcEmS 3r3w== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a11si15146081jat.23.2021.05.24.03.47.11; Mon, 24 May 2021 03:47:23 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232774AbhEXKrx (ORCPT + 99 others); Mon, 24 May 2021 06:47:53 -0400 Received: from mga11.intel.com ([192.55.52.93]:17601 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232773AbhEXKr0 (ORCPT ); Mon, 24 May 2021 06:47:26 -0400 IronPort-SDR: Y7odz+htvEmrRu4OHzO69y2ySb9FMlZL25KSDMym7++7jQdURAvvOms/SmpL4xXNo0LzTNU0DH 4cqgL371lmHQ== X-IronPort-AV: E=McAfee;i="6200,9189,9993"; a="198848349" X-IronPort-AV: E=Sophos;i="5.82,319,1613462400"; d="scan'208";a="198848349" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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