Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751779AbdLBJ6Z (ORCPT ); Sat, 2 Dec 2017 04:58:25 -0500 Received: from dd39320.kasserver.com ([85.13.155.146]:57354 "EHLO dd39320.kasserver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751699AbdLBJ6X (ORCPT ); Sat, 2 Dec 2017 04:58:23 -0500 From: Marcus Wolf To: gregkh@linuxfoundation.org, dan.carpenter@oracle.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: Marcus Wolf Subject: [PATCH] staging: pi433: Bugfix for shift operation in rf69_get_modulation() Date: Sat, 2 Dec 2017 11:58:12 +0200 Message-Id: <1512208692-29900-1-git-send-email-linux@wolf-entwicklungen.de> X-Mailer: git-send-email 1.7.10.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 879 Lines: 23 From: root Defines used in cases contain already shifted bits, so currentValue must not be shifted. Signed-off-by: Marcus Wolf --- 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