From: Dan Carpenter <dan.carpenter@oracle.com>
To: Marcus Wolf <marcus.wolf@smarthome-wolf.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: staging: pi433: Possible bug in rf69.c
Date: Fri, 10 Nov 2017 22:32:59 +0300 [thread overview]
Message-ID: <20171110193258.qv6dbokqpjrrq3yb@mwanda> (raw)
In-Reply-To: <709d3e3f-be3b-aa98-1cf6-6a048ef14d7b@smarthome-wolf.de>
On Fri, Nov 10, 2017 at 06:23:32PM +0100, Marcus Wolf wrote:
> Hi everybody!
>
> Just comparing the master of Gregs statging of pi433 with my local SVN
> to review all changes, that were done the last monthes.
>
> I am not sure, but maybe we imported a bug in rf69.c lines 378 and
> following:
>
> Gregs repo:
> case automatic: return WRITE_REG(REG_LNA, ( (READ_REG(REG_LNA) & ~MASK_LNA_GAIN) & LNA_GAIN_AUTO) );
> my repo:
> case automatic: return WRITE_REG(REG_LNA, ( (READ_REG(REG_LNA) & ~MASK_LNA_GAIN) | LNA_GAIN_AUTO) );
I edited the lines for clarity. The difference is that your repo does
a bitwise OR "| LNA_GAIN_AUTO" and the kernel.org code does a bitwise
"& LNA_GAIN_AUTO".
The kernel repo hasn't changed since you sent us the driver in commit
874bcba65f9a ('staging: pi433: New driver'). I agree that & doesn't
seem to make sense and I'm disapointed that it doesn't cause a Smatch
warning.
But LNA_GAIN_AUTO is zero so maybe | BIT(LNA_GAIN_AUTO) was intended
instead of | LNA_GAIN_AUTO. I don't know... No one on this list knows
the answer probably. :/
regards,
dan caprenter
next prev parent reply other threads:[~2017-11-10 19:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-10 17:23 staging: pi433: Possible bug in rf69.c Marcus Wolf
2017-11-10 19:32 ` Dan Carpenter [this message]
2017-11-11 7:55 ` Marcus Wolf
2017-11-11 8:40 ` Dan Carpenter
2017-11-11 8:45 ` Dan Carpenter
2017-11-11 9:42 ` Marcus Wolf
2017-11-11 11:18 ` Greg Kroah-Hartman
2017-11-11 11:42 ` Marcus Wolf
2017-11-11 11:49 ` Greg Kroah-Hartman
2017-11-11 11:51 ` Marcus Wolf
2017-11-11 12:33 ` Greg Kroah-Hartman
2017-11-11 12:10 ` Dan Carpenter
2017-11-11 16:02 ` Joe Perches
2017-11-11 16:40 ` Marcus Wolf
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=20171110193258.qv6dbokqpjrrq3yb@mwanda \
--to=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcus.wolf@smarthome-wolf.de \
/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).