lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YKuD4rturdqC6oZF@smile.fi.intel.com>
Date:   Mon, 24 May 2021 13:45:54 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     YueHaibing <yuehaibing@...wei.com>
Cc:     akpm@...ux-foundation.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] mm/dmapool: use DEVICE_ATTR_RO macro

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 <andriy.shevchenko@...ux.intel.com>

> Signed-off-by: YueHaibing <yuehaibing@...wei.com>
> ---
>  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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ