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: <b041b3a1-124a-ac48-5366-718a7dea5b9d@roeck-us.net>
Date:   Tue, 4 Dec 2018 08:59:28 -0800
From:   Guenter Roeck <linux@...ck-us.net>
To:     Yangtao Li <tiny.windzz@...il.com>, wim@...ux-watchdog.org,
        f.fainelli@...il.com, rjui@...adcom.com, sbranden@...adcom.com,
        bcm-kernel-feedback-list@...adcom.com
Cc:     linux-watchdog@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] watchdog: bcm281xx: convert to DEFINE_SHOW_ATTRIBUTE

On 12/1/18 6:51 AM, Yangtao Li wrote:
> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@...il.com>

Reviewed-by: Guenter Roeck <linux@...ck-us.net>

> ---
>   drivers/watchdog/bcm_kona_wdt.c | 16 +++-------------
>   1 file changed, 3 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/watchdog/bcm_kona_wdt.c b/drivers/watchdog/bcm_kona_wdt.c
> index 1462be9e6fc5..4249b47902bd 100644
> --- a/drivers/watchdog/bcm_kona_wdt.c
> +++ b/drivers/watchdog/bcm_kona_wdt.c
> @@ -90,7 +90,7 @@ static int secure_register_read(struct bcm_kona_wdt *wdt, uint32_t offset)
>   
>   #ifdef CONFIG_BCM_KONA_WDT_DEBUG
>   
> -static int bcm_kona_wdt_dbg_show(struct seq_file *s, void *data)
> +static int bcm_kona_show(struct seq_file *s, void *data)
>   {
>   	int ctl_val, cur_val;
>   	unsigned long flags;
> @@ -130,17 +130,7 @@ static int bcm_kona_wdt_dbg_show(struct seq_file *s, void *data)
>   	return 0;
>   }
>   
> -static int bcm_kona_dbg_open(struct inode *inode, struct file *file)
> -{
> -	return single_open(file, bcm_kona_wdt_dbg_show, inode->i_private);
> -}
> -
> -static const struct file_operations bcm_kona_dbg_operations = {
> -	.open		= bcm_kona_dbg_open,
> -	.read		= seq_read,
> -	.llseek		= seq_lseek,
> -	.release	= single_release,
> -};
> +DEFINE_SHOW_ATTRIBUTE(bcm_kona);
>   
>   static void bcm_kona_wdt_debug_init(struct platform_device *pdev)
>   {
> @@ -157,7 +147,7 @@ static void bcm_kona_wdt_debug_init(struct platform_device *pdev)
>   		return;
>   
>   	if (debugfs_create_file("info", S_IFREG | S_IRUGO, dir, wdt,
> -				&bcm_kona_dbg_operations))
> +				&bcm_kona_fops))
>   		wdt->debugfs = dir;
>   	else
>   		debugfs_remove_recursive(dir);
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ