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: <20181205153911.rlffpcc5rk2s6o6f@earth.universe>
Date:   Wed, 5 Dec 2018 16:39:11 +0100
From:   Sebastian Reichel <sre@...nel.org>
To:     Yangtao Li <tiny.windzz@...il.com>
Cc:     gregkh@...uxfoundation.org, rdunlap@...radead.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] HSI: omap_ssi: Change to use DEFINE_SHOW_ATTRIBUTE macro

Hi,

On Fri, Nov 30, 2018 at 09:33:55PM -0500, Yangtao Li wrote:
> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@...il.com>
> ---

Thanks, nice cleanup! Queued to hsi-next.

-- Sebastian

>  drivers/hsi/controllers/omap_ssi_core.c | 29 ++++---------------------
>  drivers/hsi/controllers/omap_ssi_port.c | 14 ++----------
>  2 files changed, 6 insertions(+), 37 deletions(-)
> 
> diff --git a/drivers/hsi/controllers/omap_ssi_core.c b/drivers/hsi/controllers/omap_ssi_core.c
> index 41a09f506803..a2a35319f7a5 100644
> --- a/drivers/hsi/controllers/omap_ssi_core.c
> +++ b/drivers/hsi/controllers/omap_ssi_core.c
> @@ -48,7 +48,7 @@
>  static DEFINE_IDA(platform_omap_ssi_ida);
>  
>  #ifdef CONFIG_DEBUG_FS
> -static int ssi_debug_show(struct seq_file *m, void *p __maybe_unused)
> +static int ssi_regs_show(struct seq_file *m, void *p __maybe_unused)
>  {
>  	struct hsi_controller *ssi = m->private;
>  	struct omap_ssi_controller *omap_ssi = hsi_controller_drvdata(ssi);
> @@ -63,7 +63,7 @@ static int ssi_debug_show(struct seq_file *m, void *p __maybe_unused)
>  	return 0;
>  }
>  
> -static int ssi_debug_gdd_show(struct seq_file *m, void *p __maybe_unused)
> +static int ssi_gdd_regs_show(struct seq_file *m, void *p __maybe_unused)
>  {
>  	struct hsi_controller *ssi = m->private;
>  	struct omap_ssi_controller *omap_ssi = hsi_controller_drvdata(ssi);
> @@ -117,29 +117,8 @@ static int ssi_debug_gdd_show(struct seq_file *m, void *p __maybe_unused)
>  	return 0;
>  }
>  
> -static int ssi_regs_open(struct inode *inode, struct file *file)
> -{
> -	return single_open(file, ssi_debug_show, inode->i_private);
> -}
> -
> -static int ssi_gdd_regs_open(struct inode *inode, struct file *file)
> -{
> -	return single_open(file, ssi_debug_gdd_show, inode->i_private);
> -}
> -
> -static const struct file_operations ssi_regs_fops = {
> -	.open		= ssi_regs_open,
> -	.read		= seq_read,
> -	.llseek		= seq_lseek,
> -	.release	= single_release,
> -};
> -
> -static const struct file_operations ssi_gdd_regs_fops = {
> -	.open		= ssi_gdd_regs_open,
> -	.read		= seq_read,
> -	.llseek		= seq_lseek,
> -	.release	= single_release,
> -};
> +DEFINE_SHOW_ATTRIBUTE(ssi_regs);
> +DEFINE_SHOW_ATTRIBUTE(ssi_gdd_regs);
>  
>  static int ssi_debug_add_ctrl(struct hsi_controller *ssi)
>  {
> diff --git a/drivers/hsi/controllers/omap_ssi_port.c b/drivers/hsi/controllers/omap_ssi_port.c
> index 2ada82d2ec8c..b2b3989ccfd2 100644
> --- a/drivers/hsi/controllers/omap_ssi_port.c
> +++ b/drivers/hsi/controllers/omap_ssi_port.c
> @@ -57,7 +57,7 @@ static void ssi_debug_remove_port(struct hsi_port *port)
>  	debugfs_remove_recursive(omap_port->dir);
>  }
>  
> -static int ssi_debug_port_show(struct seq_file *m, void *p __maybe_unused)
> +static int ssi_port_regs_show(struct seq_file *m, void *p __maybe_unused)
>  {
>  	struct hsi_port *port = m->private;
>  	struct omap_ssi_port *omap_port = hsi_port_drvdata(port);
> @@ -132,17 +132,7 @@ static int ssi_debug_port_show(struct seq_file *m, void *p __maybe_unused)
>  	return 0;
>  }
>  
> -static int ssi_port_regs_open(struct inode *inode, struct file *file)
> -{
> -	return single_open(file, ssi_debug_port_show, inode->i_private);
> -}
> -
> -static const struct file_operations ssi_port_regs_fops = {
> -	.open		= ssi_port_regs_open,
> -	.read		= seq_read,
> -	.llseek		= seq_lseek,
> -	.release	= single_release,
> -};
> +DEFINE_SHOW_ATTRIBUTE(ssi_port_regs);
>  
>  static int ssi_div_get(void *data, u64 *val)
>  {
> -- 
> 2.17.0
> 

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ