All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: pi433: fix a precedence bug
@ 2017-07-19  9:51 Dan Carpenter
  2017-07-19 10:11 ` walter harms
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-07-19  9:51 UTC (permalink / raw)
  To: kernel-janitors

We had intended to do the mask first and then the shift.  Shift has
higher precedence so we need to add parenthesis.

Fixes: 874bcba65f9a ("staging: pi433: New driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index e391ce777bc7..5089449bf775 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -387,7 +387,7 @@ enum lnaGain rf69_get_lna_gain(struct spi_device *spi)
 
 	currentValue = READ_REG(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;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-19 17:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-19  9:51 [PATCH] staging: pi433: fix a precedence bug Dan Carpenter
2017-07-19 10:11 ` walter harms
2017-07-19 10:26 ` Dan Carpenter
2017-07-19 17:45 ` Marcus Wolf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.