public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: iio: industrialio-core: Fix compiler warning
@ 2011-08-22 10:08 Maxin B. John
  2011-08-22 11:37 ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Maxin B. John @ 2011-08-22 10:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jonathan Cameron, Michael Hennerich, Manuel Stahl, Bryan Freed,
	linux-iio, devel, linux-kernel

drivers/staging/iio/industrialio-core.c: In function
'iio_device_add_event_sysfs':
drivers/staging/iio/industrialio-core.c:914: warning: 'mask' may be
used uninitialized in this function

Signed-off-by: Maxin B. John <maxin.john@gmail.com>
---
diff --git a/drivers/staging/iio/industrialio-core.c b/drivers/staging/iio/industrialio-core.c
index 19819e7..83b5953 100644
--- a/drivers/staging/iio/industrialio-core.c
+++ b/drivers/staging/iio/industrialio-core.c
@@ -911,7 +911,7 @@ static int iio_device_add_event_sysfs(struct iio_dev *dev_info,
 				      struct iio_chan_spec const *chan)
 {
 
-	int ret = 0, i, mask;
+	int ret = 0, i, mask = 0;
 	char *postfix;
 	if (!chan->event_mask)
 		return 0;
@@ -944,6 +944,8 @@ static int iio_device_add_event_sysfs(struct iio_dev *dev_info,
 			break;
 		default:
 			printk(KERN_INFO "currently unhandled type of event\n");
+			ret = -EINVAL;
+			goto error_ret;
 		}
 		ret = __iio_add_chan_devattr(postfix,
 					     NULL,

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

end of thread, other threads:[~2011-08-22 11:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-22 10:08 [PATCH] staging: iio: industrialio-core: Fix compiler warning Maxin B. John
2011-08-22 11:37 ` Jonathan Cameron
2011-08-22 11:44   ` Maxin B John

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox