mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Ethan Zhao <ethan.zhao@oracle.com>
Cc: anish@chelsio.com, apw@canonical.com,
	linux-kernel@vger.kernel.org, ethan.kernel@gmail.com,
	joe.jin@oracle.com
Subject: Re: [Bug report] Hit false positives bug with script/checkpatch.pl
Date: Tue, 15 Jul 2014 21:20:32 -0700	[thread overview]
Message-ID: <1405484432.14773.19.camel@joe-AO725> (raw)
In-Reply-To: <1405479036-6763-1-git-send-email-ethan.zhao@oracle.com>

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...



  reply	other threads:[~2014-07-16  4:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-16  2:50 Ethan Zhao
2014-07-16  4:20 ` Joe Perches [this message]
2014-07-16  5:39   ` Anish Bhatt
2014-07-16  7:01     ` Ethan Zhao
2014-07-16  6:55   ` ethan zhao

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=1405484432.14773.19.camel@joe-AO725 \
    --to=joe@perches.com \
    --cc=anish@chelsio.com \
    --cc=apw@canonical.com \
    --cc=ethan.kernel@gmail.com \
    --cc=ethan.zhao@oracle.com \
    --cc=joe.jin@oracle.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®