Skip to contentSkip to conversation

staging: pi433: Bugfix for shift operation in rf69_get_modulation()

PATCH In review Marcus Wolf 2 participants 2 messages Dec 2, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: pi433: Bugfix for shift operation in rf69_get_modulation()

Defines used in cases contain already shifted bits, so currentValue must not be shifted.
signed_of_by: Marcus Wolf <[email protected]>

---
 drivers/staging/pi433/rf69.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/pi433/rf69.c +1 -1
index e69a215..12c9df9 100644
@@ -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;
Signature · 1 line
1.7.10.4
maintainer
#1 lore raw
Quoted 1 line · Marcus Wolf

Defines used in cases contain already shifted bits, so currentValue must not be shifted.

Please properly wrap your changelog text.

And you need a blank line before your signed-off-by line.

Quoted 1 line

signed_of_by: Marcus Wolf <[email protected]>

"Signed-off-by:"

Did you run scripts/checkpatch.pl on your patch?

You sent 4 patches just now, which order should I apply them in? I have no idea, so please fix them up and resend them as a numbered patch series so that I have a chance to get it right.

thanks,

greg k-h