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: <F129B4E0-91B1-4B7B-AF5D-A5EA29486A6E@holtmann.org>
Date:   Tue, 28 Nov 2017 09:43:43 +0100
From:   Marcel Holtmann <marcel@...tmann.org>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     Johan Hedberg <johan.hedberg@...il.com>,
        "open list:BLUETOOTH DRIVERS" <linux-bluetooth@...r.kernel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Network Development <netdev@...r.kernel.org>,
        Randy Dunlap <rdunlap@...radead.org>
Subject: Re: [PATCH v2 1/2] seq_file: Introduce DEFINE_SHOW_ATTRIBUTE() helper
 macro

Hi Andy,

> The DEFINE_SHOW_ATTRIBUTE() helper macro would be useful for current
> users, which are many of them, and for new comers to decrease code
> duplication.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
> include/linux/seq_file.h | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
> 
> diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
> index c32929802c25..73adc12ab773 100644
> --- a/include/linux/seq_file.h
> +++ b/include/linux/seq_file.h
> @@ -144,6 +144,19 @@ void *__seq_open_private(struct file *, const struct seq_operations *, int);
> int seq_open_private(struct file *, const struct seq_operations *, int);
> int seq_release_private(struct inode *, struct file *);
> 
> +#define DEFINE_SHOW_ATTRIBUTE(__name)					      \
> +static int __name ## _open(struct inode *inode, struct file *file)	      \
> +{									      \
> +	return single_open(file, __name ## _show, inode->i_private);	      \
> +}									      \
> +									      \
> +static const struct file_operations __name ## _fops = {			      \
> +	.open		= __name ## _open,				      \
> +	.read		= seq_read,					      \
> +	.llseek		= seq_lseek,					      \
> +	.release	= single_release,				      \
> +}									      \
> +

can we define this in hci_debugfs.c first and get that patch merged into bluetooth-next. And only as a follow up patch try to generalize this in seq_file.h. I really don’t like to carry a patch for seq_file.h in the bluetooth-next tree.

Regards

Marcel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ