All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] iio: adc: at91: signedness bug in at91_adc_get_trigger_value_by_name()
@ 2014-06-11  6:53 ` Dan Carpenter
  0 siblings, 0 replies; 14+ messages in thread
From: Dan Carpenter @ 2014-06-11  6:53 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Grant Likely, Rob Herring, Josh Wu, Alexandre Belloni,
	Nicolas Ferre, Maxime Ripard, Lars-Peter Clausen, Thomas Meyer,
	Wei Yongjun, Sachin Kamat, linux-iio, kernel-janitors

The function returns a u8 so the -ENOMEM is truncated to a positive
value.  The caller tests for zero returns and treats them as an error
so I have changed the -ENOMEM to 0.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
index 3b5bacd..5ebe33d 100644
--- a/drivers/iio/adc/at91_adc.c
+++ b/drivers/iio/adc/at91_adc.c
@@ -525,7 +525,7 @@ static u8 at91_adc_get_trigger_value_by_name(struct iio_dev *idev,
 				idev->id,
 				triggers[i].name);
 		if (!name)
-			return -ENOMEM;
+			return 0;
 
 		if (strcmp(trigger_name, name) = 0) {
 			value = triggers[i].value;

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

end of thread, other threads:[~2014-06-14 14:38 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-11  6:53 [patch] iio: adc: at91: signedness bug in at91_adc_get_trigger_value_by_name() Dan Carpenter
2014-06-11  6:53 ` Dan Carpenter
2014-06-11  7:36 ` walter harms
2014-06-11  7:36   ` walter harms
2014-06-11  8:12   ` Dan Carpenter
2014-06-11  8:12     ` Dan Carpenter
2014-06-11  8:27     ` walter harms
2014-06-11  8:27       ` walter harms
2014-06-11  8:13   ` [patch v2] " Dan Carpenter
2014-06-11  8:13     ` Dan Carpenter
2014-06-11 14:41     ` Alexandre Belloni
2014-06-11 14:41       ` Alexandre Belloni
2014-06-14 14:38       ` Jonathan Cameron
2014-06-14 14:38         ` Jonathan Cameron

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.