From: "Maxin B. John" <maxin.john@gmail.com>
To: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Jonathan Cameron <jic23@cam.ac.uk>,
Michael Hennerich <michael.hennerich@analog.com>,
Manuel Stahl <manuel.stahl@iis.fraunhofer.de>,
Bryan Freed <bfreed@chromium.org>,
linux-iio@vger.kernel.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] staging: iio: industrialio-core: Fix compiler warning
Date: Mon, 22 Aug 2011 13:08:24 +0300 [thread overview]
Message-ID: <20110822100824.GA6671@maxin> (raw)
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,
next reply other threads:[~2011-08-22 10:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-22 10:08 Maxin B. John [this message]
2011-08-22 11:37 ` [PATCH] staging: iio: industrialio-core: Fix compiler warning Jonathan Cameron
2011-08-22 11:44 ` Maxin B John
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110822100824.GA6671@maxin \
--to=maxin.john@gmail.com \
--cc=bfreed@chromium.org \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=jic23@cam.ac.uk \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manuel.stahl@iis.fraunhofer.de \
--cc=michael.hennerich@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox