Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752600AbbGMWQe (ORCPT ); Mon, 13 Jul 2015 18:16:34 -0400 Received: from mout.gmx.net ([212.227.17.20]:60430 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752530AbbGMWQc (ORCPT ); Mon, 13 Jul 2015 18:16:32 -0400 Message-ID: <55A438B6.50205@gmx.de> Date: Tue, 14 Jul 2015 00:16:22 +0200 From: Hartmut Knaack User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0 SeaMonkey/2.33.1 MIME-Version: 1.0 To: Cristina Opriceana , jic23@kernel.org CC: lars@metafoo.de, pmeerw@pmeerw.net, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, daniel.baluta@intel.com, octavian.purdila@intel.com Subject: Re: [PATCH v3] tools: iio: Send error messages to stderr References: In-Reply-To: Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Provags-ID: V03:K0:KTV+P8c6phELilbiI+HcMJJMdKywQUahTy0w75bS7wrxHkJ5AC7 1QDY1hqKQKHik/6O1fPLj3cl6lxjZwwEI5ALRF4HGU8NXy3mL5O194KQxyl6JJcFKOSkASR LypFXsgDrA+4kxEmbklDNpT2+Ot2QrmS1mmZE/jBOr2eT23FfTEkMH/Fe/8LwRJ3/jumGjK Jlk/H8r1GZnn9Dx//VN9g== X-UI-Out-Filterresults: notjunk:1;V01:K0:P07hs3pUNYg=:BcZu3+LLSkMbkjpagtIEOy yyFQAsdEtBFLGMw45G+4pNApi/ZqHC1+lP4fattBlbdyOBQjG2R09ydFvO///eHp7DgWgc/wV tODA+f+hsD+3VPxEupyr7ilIG298Vdng7stwh913H/qMJcECWL/MRNVf9jLaMzK7Rhp15ieMR caJaa2ni6zO9Vj2vdC8DyrPqmiLLh/7shr6t7vyJq32s25hjz4iAzHerc/dF+WX86ILplcfEd W3m3DUvQIqaymo9cXCIWN4OZ6a4rTzemI1U4nRMP+OZ61wcha93UFLfXy2nRXE91TVpZcNxjy e0mrZm5F5Mw3N6iQEmGjD6T5e7FpZ7AJmfB65ZAS3zGnjtHOjYjwZG5lInPwszmBfDGb0ghX/ MlnER0yxfgbjozWbkN2337ZN+Px257V6IpNc38UQynjxHPILppqE+0xx/jEnWu+2sfHx+JsW0 Y1Fr7zMEBK4R7G4oyh6PPWFE1AhbSsBill3iYDsSvdEuGhQkAZFNjGJ1w4LcyIm+Sgh76TwOu vsR22Nv0YNdX5KNrx2qDksTLUb2wPPeeiNR6pcJXTAOmIxEQcjWwKjc+yqas/dRj/RTZ7OhCB iyNw0aXD40ZiNuORUD5le4uf+KIBx3d0NVagwtFqt9yHMWzhHm0Oe9NDzd8V09qmnn3i/Gjsn N6lrzCN4qJZL3Sp34dUVgJqf4FYNOkKRslbFYGziifNiR1IQL22wPYdaaqoGkpQVXnj4= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2394 Lines: 67 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 > Signed-off-by: Cristina Opriceana > --- > 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 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; > } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/