From: Antonio Quartulli <ordex@autistici.org>
To: The list for a Better Approach To Mobile Ad-hoc Networking
<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [PATCHv2 3/3] batman-adv: Modified forwarding behaviour for multicast packets
Date: Tue, 28 May 2013 18:42:34 +0200 [thread overview]
Message-ID: <20130528164234.GI3333@ritirata.org> (raw)
In-Reply-To: <201305290039.34391.lindner_marek@yahoo.de>
[-- Attachment #1: Type: text/plain, Size: 970 bytes --]
On Wed, May 29, 2013 at 12:39:33AM +0800, Marek Lindner wrote:
> On Tuesday, May 28, 2013 23:40:54 Simon Wunderlich wrote:
> > You can safe an indendation below if you return -1 immediately here
> > if the statement above is false. Also multiple statements might be better
> > for readability and later changes, e.g.
> >
> > if (!atomic_read(&bat_priv->mcast_group_awareness))
> > return 1;
> >
> > if (atomic_read(&bat_priv->mcast.num_non_aware))
> > return 1;
> >
> > if (ntohs(ethhdr->h_proto) != ETH_P_IPV6)
> > return 1;
>
> A quick hint from my end: The kernel maintainer don't like code that returns
> "random" values like 1/0/-1. Either use bool or meaningful defines instead of
> raw numbers.
Very good suggestion.
I think you can define an enum for this. It will make the code much easier to
understand.
Cheers,
--
Antonio Quartulli
..each of us alone is worth nothing..
Ernesto "Che" Guevara
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-05-28 16:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-24 8:02 [B.A.T.M.A.N.] Basic Multicast Optimizations Linus Lüssing
2013-05-24 8:02 ` [B.A.T.M.A.N.] [PATCHv2 1/3] batman-adv: Multicast Listener Announcements via Translation Table Linus Lüssing
2013-05-28 15:26 ` Simon Wunderlich
2013-05-24 8:02 ` [B.A.T.M.A.N.] [PATCHv2 2/3] batman-adv: Announce new capability via multicast TVLV Linus Lüssing
2013-05-28 15:31 ` Simon Wunderlich
2013-05-24 8:02 ` [B.A.T.M.A.N.] [PATCHv2 3/3] batman-adv: Modified forwarding behaviour for multicast packets Linus Lüssing
2013-05-28 15:40 ` Simon Wunderlich
2013-05-28 16:39 ` Marek Lindner
2013-05-28 16:42 ` Antonio Quartulli [this message]
2013-05-24 9:00 ` [B.A.T.M.A.N.] Basic Multicast Optimizations Linus Lüssing
2013-05-24 9:06 ` Antonio Quartulli
2013-05-24 9:33 ` Marek Lindner
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=20130528164234.GI3333@ritirata.org \
--to=ordex@autistici.org \
--cc=b.a.t.m.a.n@lists.open-mesh.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