From: Stefani Seibold <stefani@seibold.net>
To: Jesper Juhl <jj@chaosbits.net>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
davem@davemloft.net, netdev@vger.kernel.org,
eric.dumazet@gmail.com, shemminger@vyatta.com
Subject: Re: [PATCH] new UDPCP Communication Protocol
Date: Sun, 02 Jan 2011 22:46:12 +0100 [thread overview]
Message-ID: <1294004772.5675.11.camel@wall-e> (raw)
In-Reply-To: <alpine.LNX.2.00.1101022024200.11481@swampdragon.chaosbits.net>
Am Sonntag, den 02.01.2011, 20:55 +0100 schrieb Jesper Juhl:
> On Sun, 2 Jan 2011, stefani@seibold.net wrote:
> > +
> > +#define VERSION "0.71"
>
> I personally don't think this makes much sense.
> Version numbers for individual modules tend to not get updated as the code
> changes over the years, which make them rather meaningless.
> Since this module depends on functionallity of the kernel which it is
> compiled with, the actual (meaningful) version of this code is that of the
> kernel tree being compiled that includes this code. Which again makes this
> specific version define meaningless.
>
> So, why not save a few lines of code and get rid of this rather pointless
> thing?
>
I like it, it gives me a better monitoring during development which
version is currently tested.
> [...]
> > +static struct udpcp_dest *find_dest(struct sock *sk, __be32 addr, __be16 port)
> > +{
> > + struct udpcp_dest *dest;
> > +
> > + dest = __find_dest(sk, addr, port);
>
> Why not
>
> static struct udpcp_dest *find_dest(struct sock *sk, __be32 addr, __be16 port)
> {
> struct udpcp_dest *dest = __find_dest(sk, addr, port);
>
> ?
I will fix it but i think this is counting peas.
>
>
> [...]
> > + * Release a routing table entry if no packed will be assembled
>
> Don't you mean "packet" rather than "packed" here?
>
>
Right.
> [...]
> > + * Return true it the passed skb socket buffer is the last in the list
>
> I believe you mean "Return true if the passed ..."
>
Right.
>
> [...]
> > +static void udpcp_flush_err(struct sock *sk, struct udpcp_dest *dest)
> > +{
> > + struct inet_sock *inet = inet_sk(sk);
> > + struct udpcp_sock *usk = udpcp_sk(sk);
> > +
> > + if (!inet->recverr)
> > + skb_queue_purge(&dest->xmit);
> > + else {
>
> CodingStyle would want this as
>
> if (!inet->recverr) {
> skb_queue_purge(&dest->xmit);
> } else {
>
> If one branch needs {} then both should get them.
>
./scripts/checkpatch.pl did not complain about this, so i think it is
okay.
>
> [...]
> > + if (!dest->xmit_last)
> > + _udpcp_xmit(sk, dest);
> > + else {
> > + skb = dest->xmit_wait;
>
> Same comment as above.
> There are more occurences of this, I'm not going to point them all out.
>
>
> [...]
> > +static inline void udpcp_release_sock(struct sock *sk)
> > +{
> > + struct udpcp_sock *usk = udpcp_sk(sk);
> > +
> > + while (usk->timeout)
> > + udpcp_handle_timeout(sk);
> > + release_sock(sk);
> > + check_timeout(sk);
>
> The line above uses spaces for indentation. It should use one tab.
>
>
> [...]
> > +static unsigned int udpcp_tx_queue_len(struct sock *sk, struct udpcp_dest *dest)
> > +{
> > + struct sk_buff *skb;
> > + unsigned int n;
> > +
> > + n = 0;
>
> Might as well save a few lines and make this
>
> static unsigned int udpcp_tx_queue_len(struct sock *sk, struct udpcp_dest *dest)
> {
> struct sk_buff *skb;
> unsigned int n = 0;
>
>
> [...]
> > +static unsigned int udpcp_rx_queue_len(struct sock *sk, struct udpcp_dest *dest)
> > +{
> > + struct sk_buff *skb;
> > + unsigned int n;
> > +
> > + n = 0;
>
> Here as well
> unsigned int n = 0;
>
>
I fix it in the next release.
Thanks
next prev parent reply other threads:[~2011-01-02 21:45 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-02 15:31 [PATCH] new UDPCP Communication Protocol stefani
2011-01-02 16:34 ` Eric Dumazet
2011-01-02 19:48 ` Daniel Baluta
2011-01-02 21:33 ` Stefani Seibold
2011-01-02 21:40 ` Jesper Juhl
2011-01-02 19:55 ` Jesper Juhl
2011-01-02 21:46 ` Stefani Seibold [this message]
2011-01-02 22:04 ` Jesper Juhl
2011-01-02 22:21 ` Stefani Seibold
2011-01-02 20:16 ` Rémi Denis-Courmont
2011-01-02 21:37 ` Stefani Seibold
2011-01-02 21:55 ` Eric Dumazet
2011-01-02 22:16 ` Stefani Seibold
2011-01-02 22:31 ` Eric Dumazet
-- strict thread matches above, loose matches on Subject: below --
2011-01-11 16:48 stefani
2011-01-11 16:48 ` stefani
2011-01-11 17:01 ` Eric Dumazet
2011-01-11 20:50 ` Stefani Seibold
2011-01-11 20:52 ` David Miller
2011-01-11 21:14 ` Stefani Seibold
2011-01-11 21:19 ` David Miller
2011-01-11 21:41 ` Stefani Seibold
2011-01-11 21:46 ` Eric Dumazet
2011-01-11 22:23 ` Stefani Seibold
2011-01-11 21:30 ` Eric Dumazet
2011-01-11 21:40 ` Stefani Seibold
2011-01-11 21:06 ` Eric Dumazet
2011-01-03 14:34 stefani
2011-01-03 14:34 ` stefani
2011-01-02 22:39 stefani
2011-01-02 22:39 ` stefani
2011-01-02 22:49 ` Eric Dumazet
2011-01-02 22:55 ` Stefani Seibold
2011-01-02 23:04 ` Jesper Juhl
2011-01-03 9:08 ` Stefani Seibold
2011-01-03 9:27 ` Eric Dumazet
2011-01-03 9:54 ` Stefani Seibold
2011-01-03 10:39 ` Eric Dumazet
2011-01-03 14:08 ` Stefani Seibold
2011-01-01 21:44 stefani
2011-01-01 22:23 ` Eric Dumazet
2011-01-02 11:17 ` Stefani Seibold
2011-01-02 11:33 ` Eric Dumazet
2011-01-02 11:57 ` Stefani Seibold
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=1294004772.5675.11.camel@wall-e \
--to=stefani@seibold.net \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=jj@chaosbits.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
/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.