Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755123AbbGGIKi (ORCPT ); Tue, 7 Jul 2015 04:10:38 -0400 Received: from mail-la0-f41.google.com ([209.85.215.41]:34366 "EHLO mail-la0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752811AbbGGIKb (ORCPT ); Tue, 7 Jul 2015 04:10:31 -0400 MIME-Version: 1.0 In-Reply-To: References: Date: Tue, 7 Jul 2015 11:10:28 +0300 X-Google-Sender-Auth: wmJ-ImPrx1IsG54EQUSZGmrYjVE Message-ID: Subject: Re: [PATCH 0/4] tools: iio: Send error messages to stderr From: Daniel Baluta To: Cristina Opriceana Cc: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald , "linux-iio@vger.kernel.org" , Linux Kernel Mailing List , Daniel Baluta , "octavian.purdila@intel.com" , Julia Lawall Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1376 Lines: 59 On Tue, Jul 7, 2015 at 1:46 AM, Cristina Opriceana wrote: > This patchset indends to make some cleanup and send printf > error messages to stderr. > The changes were performed with coccinelle for failiure > messages and manual for other cases. The following script > was used: > > @r@ > expression e1, e2, stdout; > @@ > (printf(e1); > | > printf(e1, e2); > | > fprintf(stdout, e1); > | > fprintf(stdout, e1, e2); > ) > @script: python get_string@ > e << r.e1; > tdres; > @@ > if 'could not' in e.lower() or 'fail' in e.lower() \ > or 'problem' in e.lower() or 'not set' in e.lower(): > coccinelle.tdres = e > else: > cocci.include_match(False) > @r_match@ > expression r.stdout, r.e1, r.e2; > identifier get_string.tdres; > @@ > ( > - printf(e1); > + fprintf(stderr, tdres); > | > - printf(e1, e2); > + fprintf(stderr, tdres, e2); > | > - fprintf(stdout, e1) > + fprintf(stderr, tdres) > | > - fprintf(stdout, e1, e2) > + fprintf(stderr, tdres, e2) > ) Nit: s/failiure/failure this appears in several places. With this fixed: Reviewed-by: Daniel Baluta thanks, Daniel. -- 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/