Skip to contentSkip to conversation

staging: pi433: remove hardcoded mask value for easier readability

PATCH New Paulo Miguel Almeida 1 participant 1 message Mar 8, 2022 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: pi433: remove hardcoded mask value for easier readability

replace hardcoded value with the bitwise complement of the mask used to extract value sent to rf69 chip.

---
 drivers/staging/pi433/rf69.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/pi433/rf69.c +1 -1
index 3028018f0b45..659c8c1b38fd 100644
@@ -741,7 +741,7 @@ int rf69_set_fifo_threshold(struct spi_device *spi, u8 threshold)
 	int retval;
 
 	/* check input value */
-	if (threshold & 0x80) {
+	if (threshold & ~MASK_FIFO_THRESH_VALUE) {
 		dev_dbg(&spi->dev, "set: illegal fifo threshold %u\n", threshold);
 		return -EINVAL;
 	}
Signature · 1 line
2.34.1