netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Marcel Holtmann <marcel@holtmann.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	linux-bluetooth@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org
Subject: Re: [PATCH v1] Bluetooth: introduce DEFINE_SHOW_ATTRIBUTE() macro
Date: Wed, 22 Nov 2017 14:04:07 -0800	[thread overview]
Message-ID: <13210ec5-af8a-3b3e-0a1c-9ffa751651e8@infradead.org> (raw)
In-Reply-To: <20171122211546.5682-1-andriy.shevchenko@linux.intel.com>

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@linux.intel.com>
> ---
>  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

  reply	other threads:[~2017-11-22 22:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-22 21:15 [PATCH v1] Bluetooth: introduce DEFINE_SHOW_ATTRIBUTE() macro Andy Shevchenko
2017-11-22 22:04 ` Randy Dunlap [this message]
2017-11-22 22:13   ` Randy Dunlap
     [not found]     ` <2404941a-6e4a-3665-f737-00b48819d204-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2017-11-23 13:18       ` Andy Shevchenko
     [not found] ` <20171122211546.5682-1-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-12-13 19:21   ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=13210ec5-af8a-3b3e-0a1c-9ffa751651e8@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).