From mboxrd@z Thu Jan 1 00:00:00 1970 From: Randy Dunlap Subject: Re: [PATCH v1] Bluetooth: introduce DEFINE_SHOW_ATTRIBUTE() macro Date: Wed, 22 Nov 2017 14:04:07 -0800 Message-ID: <13210ec5-af8a-3b3e-0a1c-9ffa751651e8@infradead.org> References: <20171122211546.5682-1-andriy.shevchenko@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: Andy Shevchenko , Marcel Holtmann , Johan Hedberg , linux-bluetooth@vger.kernel.org, "David S. Miller" , netdev@vger.kernel.org Return-path: Received: from bombadil.infradead.org ([65.50.211.133]:39290 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751324AbdKVWEN (ORCPT ); Wed, 22 Nov 2017 17:04:13 -0500 In-Reply-To: <20171122211546.5682-1-andriy.shevchenko@linux.intel.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: 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 > --- > 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