[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110822100824.GA6671@maxin>
Date: Mon, 22 Aug 2011 13:08:24 +0300
From: "Maxin B. John" <maxin.john@...il.com>
To: Greg Kroah-Hartman <gregkh@...e.de>
Cc: Jonathan Cameron <jic23@....ac.uk>,
Michael Hennerich <michael.hennerich@...log.com>,
Manuel Stahl <manuel.stahl@....fraunhofer.de>,
Bryan Freed <bfreed@...omium.org>, linux-iio@...r.kernel.org,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH] staging: iio: industrialio-core: Fix compiler warning
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@...il.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,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists