From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Joe Perches <joe@perches.com>
Cc: tcharding <me@tobin.cc>,
Stephen Hemminger <stephen@networkplumber.org>,
"David S. Miller" <davem@davemloft.net>,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
netdev@vger.kernel.org
Subject: Re: [PATCH 1/3] bridge: netfilter: checkpatch whitespace fixes
Date: Wed, 8 Jun 2016 19:31:21 +0200 [thread overview]
Message-ID: <20160608173121.GA25147@salvia> (raw)
In-Reply-To: <1465404750.25087.68.camel@perches.com>
On Wed, Jun 08, 2016 at 09:52:30AM -0700, Joe Perches wrote:
> On Wed, 2016-06-08 at 13:52 +0200, Pablo Neira Ayuso wrote:
> > On Tue, Jun 07, 2016 at 11:02:30AM -0700, Joe Perches wrote:
> > > On Tue, 2016-06-07 at 19:34 +0200, Pablo Neira Ayuso wrote:
> > > > On Tue, Jun 07, 2016 at 10:04:40AM -0700, Joe Perches wrote:
> > > > > One more question, is this chunk below correct from
> > > > > coding style point of view?
> > > > if (info->bitmask & EBT_STP_ROOTADDR) {
> > > > verdict = 0;
> > > > for (i = 0; i < 6; i++)
> > > > - verdict |= (stpc->root[2+i] ^ c->root_addr[i]) &
> > > > - c->root_addrmsk[i];
> > > > + verdict |= (stpc->root[2 + i] ^ c->root_addr[i]) &
> > > > + c->root_addrmsk[i];
> > > >
> > > > I think the previous line is fine.
> > > "2+i" or "2 + i", either is OK.
> > > Multiple line statement alignment doesn't
> > > matter much.
> > Sorry, I was actually refering to:
> []
>
> Hi again Pablo.
>
> No worries. I hoped the "doesn't matter much" was clear enough.
>
> There are many different multiple line statement alignment
> styles in the kernel.
>
> Alignment to open parenthesis is one of them, and I think it's
> reasonable to standardize on that.
>
> For multiple line statements without parentheses for alignment,
> I think there isn't one style that's much better than another.
>
> I slightly prefer the original alignment above myself.
I do too. I can take Tobin's original patch and manually revert this
chunk then, ie.
- verdict |= (stpc->root[2+i] ^ c->root_addr[i]) &
- c->root_addrmsk[i];
+ verdict |= (stpc->root[2 + i] ^ c->root_addr[i]) &
+ c->root_addrmsk[i];
> Maybe something like this is clearer:
>
> static bool ebt_test_addr(const uint8_t *root, const char *addr,
> const char *mask)
> {
> int i;
>
> for (i = 0; i < ETH_ALEN; i++) {
> if ((root[2 + i] ^ addr[i]) & mask[i])
> return true;
> }
>
> return false;
> }
>
> Maybe the call should add the + 2 to the first argument
> instead of using + 2 in the loop.
Then you can follow up with a patch to add this function.
Just a suggestion, let me know if this is fine with you.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-06-08 17:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-10 1:26 [PATCH 0/3] bridge: netfilter: checkpatch fixes tcharding
2016-05-10 1:26 ` [PATCH 1/3] bridge: netfilter: checkpatch whitespace fixes tcharding
2016-06-07 15:14 ` Pablo Neira Ayuso
2016-06-07 17:04 ` Joe Perches
2016-06-07 17:34 ` Pablo Neira Ayuso
2016-06-07 18:02 ` Joe Perches
2016-06-08 11:52 ` Pablo Neira Ayuso
2016-06-08 16:52 ` Joe Perches
2016-06-08 17:31 ` Pablo Neira Ayuso [this message]
2016-06-08 17:38 ` Pablo Neira Ayuso
2016-06-09 18:00 ` Joe Perches
2016-06-11 10:44 ` Tobin Harding
2016-05-10 1:26 ` [PATCH 2/3] bridge: netfilter: checkpatch data type fixes tcharding
2016-06-07 15:19 ` Pablo Neira Ayuso
2016-05-10 1:26 ` [PATCH 3/3] bridge: netfilter: checkpatch null comparison fixes tcharding
2016-06-07 15:21 ` Pablo Neira Ayuso
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=20160608173121.GA25147@salvia \
--to=pablo@netfilter.org \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=joe@perches.com \
--cc=me@tobin.cc \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=stephen@networkplumber.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.