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] [day] [month] [year] [list]
Message-ID: <585a9e90-297a-3cc9-2a54-49eb82b82adf@roeck-us.net>
Date:   Tue, 4 Dec 2018 09:00:21 -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 2/2] watchdog: 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/ie6xx_wdt.c | 16 +++-------------
>   1 file changed, 3 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/watchdog/ie6xx_wdt.c b/drivers/watchdog/ie6xx_wdt.c
> index 78c2541f5d52..8de9fb1ed371 100644
> --- a/drivers/watchdog/ie6xx_wdt.c
> +++ b/drivers/watchdog/ie6xx_wdt.c
> @@ -193,7 +193,7 @@ static struct watchdog_device ie6xx_wdt_dev = {
>   
>   #ifdef CONFIG_DEBUG_FS
>   
> -static int ie6xx_wdt_dbg_show(struct seq_file *s, void *unused)
> +static int ie6xx_wdt_show(struct seq_file *s, void *unused)
>   {
>   	seq_printf(s, "PV1   = 0x%08x\n",
>   		inl(ie6xx_wdt_data.sch_wdtba + PV1));
> @@ -212,23 +212,13 @@ static int ie6xx_wdt_dbg_show(struct seq_file *s, void *unused)
>   	return 0;
>   }
>   
> -static int ie6xx_wdt_dbg_open(struct inode *inode, struct file *file)
> -{
> -	return single_open(file, ie6xx_wdt_dbg_show, NULL);
> -}
> -
> -static const struct file_operations ie6xx_wdt_dbg_operations = {
> -	.open		= ie6xx_wdt_dbg_open,
> -	.read		= seq_read,
> -	.llseek		= seq_lseek,
> -	.release	= single_release,
> -};
> +DEFINE_SHOW_ATTRIBUTE(ie6xx_wdt);
>   
>   static void ie6xx_wdt_debugfs_init(void)
>   {
>   	/* /sys/kernel/debug/ie6xx_wdt */
>   	ie6xx_wdt_data.debugfs = debugfs_create_file("ie6xx_wdt",
> -		S_IFREG | S_IRUGO, NULL, NULL, &ie6xx_wdt_dbg_operations);
> +		S_IFREG | S_IRUGO, NULL, NULL, &ie6xx_wdt_fops);
>   }
>   
>   static void ie6xx_wdt_debugfs_exit(void)
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ