Re: [PATCH v1] Bluetooth: introduce DEFINE_SHOW_ATTRIBUTE() macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/22/2017 01:15 PM, Andy Shevchenko wrote:
> This macro deduplicates a lot of similar code across the hci_debugfs.c
> module. Targeting to be moved to seq_file.h eventually.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> ---
>  net/bluetooth/hci_debugfs.c | 184 +++++---------------------------------------
>  1 file changed, 18 insertions(+), 166 deletions(-)

Looks like a good idea, but below, there is a use of
DEFINE_SHOW_ATTRIBUTE() before it is #defined.

> diff --git a/net/bluetooth/hci_debugfs.c b/net/bluetooth/hci_debugfs.c
> index 63df63ebfb24..d4174d508cbf 100644
> --- a/net/bluetooth/hci_debugfs.c
> +++ b/net/bluetooth/hci_debugfs.c
> @@ -88,6 +88,9 @@ static int __name ## _show(struct seq_file *f, void *ptr)		      \
>  	return 0;							      \
>  }									      \
>  									      \
> +DEFINE_SHOW_ATTRIBUTE(__name)

eh?

> +> +#define DEFINE_SHOW_ATTRIBUTE(__name)					      \
>  static int __name ## _open(struct inode *inode, struct file *file)	      \
>  {									      \
>  	return single_open(file, __name ## _show, inode->i_private);	      \


-- 
~Randy
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux