[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABawtvO3K0141gC8vh-TwUNnegbGVLuqXizjJXWR2W5B89PE2A@mail.gmail.com>
Date: Wed, 16 Jul 2014 15:01:40 +0800
From: Ethan Zhao <ethan.kernel@...il.com>
To: Anish Bhatt <anish@...lsio.com>
Cc: Joe Perches <joe@...ches.com>, Ethan Zhao <ethan.zhao@...cle.com>,
"apw@...onical.com" <apw@...onical.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"joe.jin@...cle.com" <joe.jin@...cle.com>
Subject: Re: [Bug report] Hit false positives bug with script/checkpatch.pl
On Wed, Jul 16, 2014 at 1:39 PM, Anish Bhatt <anish@...lsio.com> wrote:
> Parantheses/do {...} while(0) would not work for direct value substituons like this obviously but fixing this false positive seems hard. An exception
How about lower it to warning... ... if it is hard to fix.
Ethan
case that is something like "macros with complex values separated by
commas but no statements terminated by semicolons" is my best but
seems-very-vague guess.
> -Anish
> ________________________________________
> From: Joe Perches [joe@...ches.com]
> Sent: Tuesday, July 15, 2014 9:20 PM
> To: Ethan Zhao
> Cc: Anish Bhatt; apw@...onical.com; linux-kernel@...r.kernel.org; ethan.kernel@...il.com; joe.jin@...cle.com
> Subject: Re: [Bug report] Hit false positives bug with script/checkpatch.pl
>
> On Wed, 2014-07-16 at 10:50 +0800, Ethan Zhao wrote:
>> Hi,
>> I hit a false positives bug when run script/checkpatch.pl to my patch,
>> It reported errors to following macro definition, but in fact the macro is
>> correct, I couldn't change that macro according to the error message output
>> by script/checkpatch.pl. because of this bug, my patch was rejected by some
>> guy's patchwork.
>
> You could tell the guy checkpatch isn't always right.
>
> You could also change the macro to something like:
>
> #define NETXEN_NIC_STAT(name, m) \
> { \
> .name = name, \
> .type = m, \
> .sizeof_stat = FIELD_SIZEOF(struct netxen_adapter, m), \
> .stat_offset = offsetof(struct netxen_adapter, m) \
> }
>
> and change the uses like:
>
> static const struct netxen_nic_stats netxen_nic_gstrings_stats[] = {
> NETXEN_NIC_STAT("xmit called", stats.xmitcalled),
> NETXEN_NIC_STAT("xmit_finished", stats.xmitfinished),
>
> etc...
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists