Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753498AbdLMPIF (ORCPT ); Wed, 13 Dec 2017 10:08:05 -0500 Received: from mail.CARNet.hr ([161.53.123.6]:56472 "EHLO mail.carnet.hr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753324AbdLMPGG (ORCPT ); Wed, 13 Dec 2017 10:06:06 -0500 From: Valentin Vidic To: Greg Kroah-Hartman Cc: =?UTF-8?q?Simon=20Sandstr=C3=B6m?= , Marcin Ciupak , Marcus Wolf , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Valentin Vidic Date: Wed, 13 Dec 2017 15:21:52 +0100 Message-Id: <20171213142156.3201-4-Valentin.Vidic@CARNet.hr> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171213142156.3201-1-Valentin.Vidic@CARNet.hr> References: <20171213142156.3201-1-Valentin.Vidic@CARNet.hr> X-SA-Exim-Connect-IP: 161.53.12.131 Subject: [PATCH 4/8] staging: pi433: add parentheses to mask and shift X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1373 Lines: 33 Fixes checkpatch warning: WARNING: Possible precedence defect with mask then right shift - may need parentheses Signed-off-by: Valentin Vidic --- drivers/staging/pi433/rf69.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c index f77ecd60f43a..b1e243e5bcac 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 = rf69_read_reg(spi, REG_DATAMODUL); - switch (currentValue & MASK_DATAMODUL_MODULATION_TYPE >> 3) { // TODO improvement: change 3 to define + switch ((currentValue & MASK_DATAMODUL_MODULATION_TYPE) >> 3) { // TODO improvement: change 3 to define case DATAMODUL_MODULATION_TYPE_OOK: return OOK; case DATAMODUL_MODULATION_TYPE_FSK: return FSK; default: return UNDEF; @@ -340,7 +340,7 @@ enum lnaGain rf69_get_lna_gain(struct spi_device *spi) currentValue = rf69_read_reg(spi, REG_LNA); - switch (currentValue & MASK_LNA_CURRENT_GAIN >> 3) { // improvement: change 3 to define + switch ((currentValue & MASK_LNA_CURRENT_GAIN) >> 3) { // improvement: change 3 to define case LNA_GAIN_AUTO: return automatic; case LNA_GAIN_MAX: return max; case LNA_GAIN_MAX_MINUS_6: return maxMinus6; -- 2.15.0