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.shevche...@linux.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

Reply via email to