mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marcus Wolf <linux@wolf-entwicklungen.de>
To: gregkh@linuxfoundation.org, dan.carpenter@oracle.com,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH] staging: pi433: Bugfix for shift operation in rf69_get_modulation()
Date: Sat,  2 Dec 2017 12:32:20 +0200	[thread overview]
Message-ID: <1512210741-475-1-git-send-email-linux@wolf-entwicklungen.de> (raw)

Defines used in cases contain already shifted bits, so currentValue must not be shifted.
signed_of_by: Marcus Wolf <linux@wolf-entwicklungen.de>
---
 drivers/staging/pi433/rf69.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index e69a215..12c9df9 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -102,7 +102,7 @@ enum modulation rf69_get_modulation(struct spi_device *spi)
 
 	currentValue = READ_REG(REG_DATAMODUL);
 
-	switch (currentValue & MASK_DATAMODUL_MODULATION_TYPE >> 3) { // TODO improvement: change 3 to define
+	switch (currentValue & MASK_DATAMODUL_MODULATION_TYPE) {
 	case DATAMODUL_MODULATION_TYPE_OOK: return OOK;
 	case DATAMODUL_MODULATION_TYPE_FSK: return FSK;
 	default:			    return undefined;
-- 
1.7.10.4

             reply	other threads:[~2017-12-02 10:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-02 10:32 Marcus Wolf [this message]
2017-12-02 14:58 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2017-12-02 10:51 Marcus Wolf
2017-12-02 14:59 ` Greg KH
2017-12-02  9:58 Marcus Wolf
2017-12-02 10:06 ` Greg KH
2017-12-02 10:10   ` 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=1512210741-475-1-git-send-email-linux@wolf-entwicklungen.de \
    --to=linux@wolf-entwicklungen.de \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®