All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Joe Perches <joe@perches.com>
Cc: <linux-wireless@vger.kernel.org>, <ath6kl@lists.infradead.org>
Subject: Re: [PATCH 5/6] ath6kl: remove a warning on a macro
Date: Mon, 10 Mar 2014 19:29:41 +0200	[thread overview]
Message-ID: <87y50iklmi.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <1394349609.6972.39.camel@joe-AO722> (Joe Perches's message of "Sat, 8 Mar 2014 23:20:09 -0800")

Joe Perches <joe@perches.com> writes:

> On Sun, 2014-03-09 at 09:10 +0200, Kalle Valo wrote:
>
>> I would need help with this checkpatch warning:
>
> No idea what the warning is.

Hmm, maybe I'll just disable the warning in my check script.

>> > --- a/drivers/net/wireless/ath/ath6kl/debug.c
>> > +++ b/drivers/net/wireless/ath/ath6kl/debug.c
>> > @@ -798,12 +798,10 @@ static ssize_t ath6kl_endpoint_stats_read(struct file *file,
>> >  		return -ENOMEM;
>> >  
>> >  #define EPSTAT(name)							\
>> > -	do {								\
>> > -		len = print_endpoint_stat(target, buf, buf_len, len,	\
>> > -					  offsetof(struct htc_endpoint_stats, \
>> > -						   name),		\
>> > -					  #name);			\
>> > -	} while (0)
>> > +	(len = print_endpoint_stat(target, buf, buf_len, len,		\
>> > +				   offsetof(struct htc_endpoint_stats,	\
>> > +					    name),			\
>> > +				   #name))
>> 
>> I wasn't quite able to figure out what is the preferred style here. I
>> don't see how the () style is any better, but checkpatch didn't complain
>> at least.
>
> No idea what the preferred style is, but
> I'd probably change the #define to
>
> #define EPSTAT(name)							\
> 	print_endpoint_stat(target, buf, buf_len, len,			\
> 			    offsetof(struct htc_endpoint_stats, name),	\
> 			    #name)
>
> and the uses to
>
> 	len = EPSTAT(whatever);

The problem with this is that using of len as an argument is hidden but
storing the result is visible. Maybe it's better that I just disable the
warning for me and not worry about this.

-- 
Kalle Valo

  parent reply	other threads:[~2014-03-10 17:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-09  6:57 [PATCH 0/6] ath6kl: fixing new checkpatch warnings Kalle Valo
2014-03-09  6:57 ` [PATCH 1/6] ath6kl: fix blank lines before and after braces Kalle Valo
2014-03-09  6:57 ` [PATCH 2/6] ath6kl: use braces on both arms of if statement Kalle Valo
2014-03-09 21:42   ` Joe Perches
2014-03-10 17:23     ` Kalle Valo
2014-03-12  8:47     ` Jones Desougi
2014-03-12  8:52       ` Kalle Valo
2014-03-12 14:11         ` Joe Perches
2014-03-09  6:57 ` [PATCH 3/6] ath6kl: remove spaces before semicolon Kalle Valo
2014-03-09  6:57 ` [PATCH 4/6] ath6kl: remove unnecessary line continuations Kalle Valo
2014-03-09 21:15   ` Joe Perches
2014-03-10 17:26     ` Kalle Valo
2014-03-09  6:57 ` [PATCH 5/6] ath6kl: remove a warning on a macro Kalle Valo
2014-03-09  7:10   ` Kalle Valo
2014-03-09  7:20     ` Joe Perches
2014-03-09  7:44       ` Joe Perches
2014-03-10 17:29       ` Kalle Valo [this message]
2014-03-10 20:03         ` Joe Perches
2014-03-09  6:57 ` [PATCH 6/6] ath6kl: update Kconfig descriptions Kalle Valo
2014-03-13  5:48 ` [PATCH 0/6] ath6kl: fixing new checkpatch warnings Kalle Valo

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=87y50iklmi.fsf@kamboji.qca.qualcomm.com \
    --to=kvalo@qca.qualcomm.com \
    --cc=ath6kl@lists.infradead.org \
    --cc=joe@perches.com \
    --cc=linux-wireless@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.