linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chinmay V S <cvs268@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: elder@kernel.org, johan@kernel.org,
	"Bryan O'Donoghue" <pure.logic@nexus-software.ie>,
	devel@driverdev.osuosl.org,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] staging: greybus: Fix macro definition
Date: Sat, 3 Dec 2016 16:17:37 +0530	[thread overview]
Message-ID: <CAK-9PRD8AavbsJZxyOzR_RZMbphwbXs-J-wfLPBKEnzT55DHLw@mail.gmail.com> (raw)
In-Reply-To: <20161203102247.GA15098@kroah.com>

On Sat, Dec 3, 2016 at 3:52 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Sat, Dec 03, 2016 at 03:41:19PM +0530, Chinmay VS wrote:
>> From: ChinmayVS <cvs268@gmail.com>
>>
>> Macros with multiple statements should be enclosed in a do - while loop
>>
>> Signed-off-by: ChinmayVS <cvs268@gmail.com>
>> ---
>>  drivers/staging/greybus/loopback.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c
>> index 7882306..39f0a25 100644
>> --- a/drivers/staging/greybus/loopback.c
>> +++ b/drivers/staging/greybus/loopback.c
>> @@ -177,9 +177,11 @@ static ssize_t name##_avg_show(struct device *dev,               \
>>  static DEVICE_ATTR_RO(name##_avg)
>>
>>  #define gb_loopback_stats_attrs(field)                               \
>> +do {                                                         \
>>       gb_loopback_ro_stats_attr(field, min, u);               \
>>       gb_loopback_ro_stats_attr(field, max, u);               \
>> -     gb_loopback_ro_avg_attr(field)
>> +     gb_loopback_ro_avg_attr(field)                          \
>> +} while (0)
>>
>>  #define gb_loopback_attr(field, type)                                        \
>>  static ssize_t field##_show(struct device *dev,                              \
>
> Always build test your changes so you don't get a grumpy maintainer
> yelling at you for not test-building your patches...
>

Thanks. My bad.
Now that i tried and saw it doesn't even build, i see my mistake.
gb_loopback_stats_attrs() is used to define functions from a template.
The macro is not in any function by itself already.

Back to running checkpatch and finding other ERRORs to cleanup in staging.
(will remember to +V before pushing to the mailing list.)

  reply	other threads:[~2016-12-03 10:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-03 10:11 [PATCH] staging: greybus: Fix macro definition Chinmay VS
2016-12-03 10:22 ` Greg KH
2016-12-03 10:47   ` Chinmay V S [this message]
2016-12-03 20:24 ` kbuild test robot

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=CAK-9PRD8AavbsJZxyOzR_RZMbphwbXs-J-wfLPBKEnzT55DHLw@mail.gmail.com \
    --to=cvs268@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=elder@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pure.logic@nexus-software.ie \
    /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).