From: Andrew Morton <akpm@linux-foundation.org>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
Thomas Sailer <t.sailer@alumni.ethz.ch>
Subject: Re: [PATCH] net/hamradio: fix test in receive()
Date: Tue, 13 Oct 2009 19:10:03 -0700 [thread overview]
Message-ID: <20091013191003.9778c4bb.akpm@linux-foundation.org> (raw)
In-Reply-To: <4ACB27E8.8060401@gmail.com>
On Tue, 06 Oct 2009 13:20:08 +0200 Roel Kluin <roel.kluin@gmail.com> wrote:
> The negation makes it a bool before the comparison and hence it
> will never evaluate to true.
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> Was this intended?
>
> diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c
> index 7bcaf7c..ee06a13 100644
> --- a/drivers/net/hamradio/baycom_epp.c
> +++ b/drivers/net/hamradio/baycom_epp.c
> @@ -596,7 +596,8 @@ static int receive(struct net_device *dev, int cnt)
> state = 0;
>
> /* not flag received */
> - else if (!(bitstream & (0x1fe << j)) != (0x0fc << j)) {
> + else if ((bitstream & (0x1fe << j)) !=
> + (0x0fc << j)) {
> if (state)
> do_rxpacket(dev);
> bc->hdlcrx.bufcnt = 0;
It does look like that is what was intended.
With this fix we're turning on a code path which probably hasn't been
executed by anyone in a decade or so. I wonder what it'll do?
prev parent reply other threads:[~2009-10-14 2:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-06 11:20 [PATCH] net/hamradio: fix test in receive() Roel Kluin
2009-10-13 10:47 ` David Miller
2009-10-14 2:10 ` Andrew Morton [this message]
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=20091013191003.9778c4bb.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=roel.kluin@gmail.com \
--cc=t.sailer@alumni.ethz.ch \
/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;
as well as URLs for NNTP newsgroup(s).