* [PATCH] staging: iio: generic_buffer: initialize ret
@ 2013-10-07 12:42 Sebastian Andrzej Siewior
2013-10-12 11:20 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2013-10-07 12:42 UTC (permalink / raw)
To: Jonathan Cameron
Cc: linux-iio, Greg Kroah-Hartman, devel, Sebastian Andrzej Siewior
The `ret´ variable is only initialized in the error case. For some reason
it was always != 0 while I played with generic_buffer so here is a patch.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
drivers/staging/iio/Documentation/iio_utils.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/iio/Documentation/iio_utils.h b/drivers/staging/iio/Documentation/iio_utils.h
index cf32ae0..35154d6 100644
--- a/drivers/staging/iio/Documentation/iio_utils.h
+++ b/drivers/staging/iio/Documentation/iio_utils.h
@@ -502,7 +502,7 @@ inline int find_type_by_name(const char *name, const char *type)
inline int _write_sysfs_int(char *filename, char *basedir, int val, int verify)
{
- int ret;
+ int ret = 0;
FILE *sysfsfp;
int test;
char *temp = malloc(strlen(basedir) + strlen(filename) + 2);
--
1.8.4.rc3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: iio: generic_buffer: initialize ret
2013-10-07 12:42 [PATCH] staging: iio: generic_buffer: initialize ret Sebastian Andrzej Siewior
@ 2013-10-12 11:20 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2013-10-12 11:20 UTC (permalink / raw)
To: Sebastian Andrzej Siewior; +Cc: linux-iio, Greg Kroah-Hartman, devel
On 10/07/13 13:42, Sebastian Andrzej Siewior wrote:
> The `ret´ variable is only initialized in the error case. For some reason
> it was always != 0 while I played with generic_buffer so here is a patch.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Thanks,
Applied to the togreg branch of iio.git
> ---
> drivers/staging/iio/Documentation/iio_utils.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/iio/Documentation/iio_utils.h b/drivers/staging/iio/Documentation/iio_utils.h
> index cf32ae0..35154d6 100644
> --- a/drivers/staging/iio/Documentation/iio_utils.h
> +++ b/drivers/staging/iio/Documentation/iio_utils.h
> @@ -502,7 +502,7 @@ inline int find_type_by_name(const char *name, const char *type)
>
> inline int _write_sysfs_int(char *filename, char *basedir, int val, int verify)
> {
> - int ret;
> + int ret = 0;
> FILE *sysfsfp;
> int test;
> char *temp = malloc(strlen(basedir) + strlen(filename) + 2);
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-10-12 10:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-07 12:42 [PATCH] staging: iio: generic_buffer: initialize ret Sebastian Andrzej Siewior
2013-10-12 11:20 ` 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.