Skip to contentSkip to conversation

staging:iio:ad7291 faciliate ad7291_read_event_config()

PATCH Applied Hartmut Knaack 2 participants 2 messages Jul 8, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 5/6 staging:iio:ad7291 faciliate ad7291_read_event_config()

Save some lines in returning a voltage event.

---

drivers/staging/iio/adc/ad7291.c +1 -4
index 654b39e..06eb0c0 100644
@@ -242,10 +242,7 @@ static int ad7291_read_event_config(struct iio_dev *indio_dev,
 
 	switch (chan->type) {
 	case IIO_VOLTAGE:
-		if (chip->c_mask & BIT(15 - chan->channel))
-			return 1;
-		else
-			return 0;
+		return !!(chip->c_mask & BIT(15 - chan->channel));
 	case IIO_TEMP:
 		/* always on */
 		return 1;
maintainer Applied
#1 lore raw
Quoted 3 lines · Hartmut Knaack

Save some lines in returning a voltage event.

Applied to the togreg branch of iio.git

Thanks

Quoted 22 lines

---

drivers/staging/iio/adc/ad7291.c +1 -5
index 654b39e..06eb0c0 100644
@@ -242,10 +242,7 @@ static int ad7291_read_event_config(struct iio_dev *indio_dev,
 
  	switch (chan->type) {
  	case IIO_VOLTAGE:
-		if (chip->c_mask & BIT(15 - chan->channel))
-			return 1;
-		else
-			return 0;
+		return !!(chip->c_mask & BIT(15 - chan->channel));
  	case IIO_TEMP:
  		/* always on */
  		return 1;
--

To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html