lkml.org 
[lkml]   [2015]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v3] tools: iio: Send error messages to stderr
Cristina Opriceana schrieb am 13.07.2015 um 15:33:
> This patch intends to make some cleanup and send printf
> error messages to stderr. The changes were performed with coccinelle
> for failure messages and manual for other cases, such as wrong usage
> messages.
>

Looking very good so far. Two off-by-one indentation issues spotted however
(checkpatch didn't spot at least the first one), but after fixing you can
add my

Reviewed-by: Hartmut Knaack <knaack.h@gmx.de>

> Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
> ---
> Changes since v2:
> - merge all replacements in one commit
>
> tools/iio/generic_buffer.c | 23 +++++++++++---------
> tools/iio/iio_event_monitor.c | 14 ++++++-------
> tools/iio/iio_utils.c | 49 +++++++++++++++++++++++++------------------
> tools/iio/lsiio.c | 2 +-
> 4 files changed, 50 insertions(+), 38 deletions(-)
>
> diff --git a/tools/iio/generic_buffer.c b/tools/iio/generic_buffer.c
> index 9535c2d..249858a 100644
> --- a/tools/iio/generic_buffer.c
> +++ b/tools/iio/generic_buffer.c
> @@ -193,7 +193,7 @@ void process_scan(char *data,
>
> void print_usage(void)
> {
> - printf("Usage: generic_buffer [options]...\n"
> + fprintf(stderr, "Usage: generic_buffer [options]...\n"
> "Capture, convert and output data from IIO device buffer\n"
> " -c <n> Do n conversions\n"
> " -e Disable wait for event (new data)\n"

These lines should be moved one space to the right, as well.

<...>
> diff --git a/tools/iio/iio_utils.c b/tools/iio/iio_utils.c
> index e177f40..15bd663 100644
> --- a/tools/iio/iio_utils.c
> +++ b/tools/iio/iio_utils.c
<...>
> @@ -800,8 +808,9 @@ static int _write_sysfs_string(const char *filename, const char *basedir,
> }
>
> if (strcmp(temp, val) != 0) {
> - printf("Possible failure in string write of %s "
> - "Should be %s written to %s/%s\n", temp, val,
> + fprintf(stderr,
> + "Possible failure in string write of %s "
> + "Should be %s written to %s/%s\n", temp, val,
> basedir, filename);

And this is the other instance.

> ret = -1;
> }



\
 
 \ /
  Last update: 2015-07-14 00:41    [W:0.042 / U:1.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site