Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp27042imm; Fri, 10 Aug 2018 07:05:54 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzqyuwFbAGexAPM48GcxmNSvrXNNKQG6scZ8tBy9yImodZTiBcaOD8TkmV9S0qLt/PILeZ4 X-Received: by 2002:a17:902:7009:: with SMTP id y9-v6mr6456273plk.249.1533909954132; Fri, 10 Aug 2018 07:05:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533909954; cv=none; d=google.com; s=arc-20160816; b=u6rUw5QyDOjpXJ0wY0ZSHwFDxyIiHvKZ4ualiEWAP4rtXta2+5FfWyjdk9iclbXera QHyBT7RiRx/hkxWneh6e4/URfybw5Kkd7JVQKwilyoAQz57BNNKdIUok43ZdHV0cUrFw hj5A8pVTxPwuUHZL7rq9okAZcsrZc3lGqK6eGfT2haqvwPMcDtvBkapNi7FIg98jpfq+ /ENKzCmNq7mYnMZdjDiLIOIkL/B9GVFwGTDyy1GPEIoxVTlRBXNYzu5dqCjzTxxWGAB+ FuPMC5sWZTCkSnf0lacJV/Lbi8N6vsWh2aHJF+8ORbOTMc6tfQljcTrA4fkzzUI9IQ7R DgQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=18mEhK2IzayjExUp3Gct25ITOI+SPMKTQJniNOD43cU=; b=RAzqMhteWpcQLjvL0QDuHmCNdp2teXUhe9tiXMWEFd9POkfuiHWho+T6gP6Gk2jHOM TZT/B3Ar1xQZMIzXG9sXL05AWyT6RU5nbBp7Alzi17EjuF/rE79nXNFBDt6VQiWs2J52 +aKeVDKGBTmDJO/YBcSQ8JvcNs4deF3/kWr77q2w9+YhmT2+YszpV3T6vdAcaryXG/Cc XuDnD8mhHQcOcb/7wYKWkTgSzi+JiBTk8WrrCjBq7NXtLZOIDsOAQFxZyxxQKVehkhHM pjgr+3/mk4txz0tARB2iu1Tyj2U6v2XRwpBsjLEf9Gf7+7NpLsOQoto4kYDWSaSwJUv9 ff9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1-v6si7579250pld.424.2018.08.10.07.05.38; Fri, 10 Aug 2018 07:05:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728229AbeHJQNC (ORCPT + 99 others); Fri, 10 Aug 2018 12:13:02 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:21473 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727624AbeHJQNB (ORCPT ); Fri, 10 Aug 2018 12:13:01 -0400 X-IronPort-AV: E=Sophos;i="5.53,219,1531778400"; d="scan'208";a="275506813" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Aug 2018 15:43:01 +0200 Date: Fri, 10 Aug 2018 15:42:54 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Denis Efremov cc: Masahiro Yamada , "Luis R . Rodriguez" , Nicolas Palix , Gilles Muller , Michal Marek , linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: Re: [PATCH] coccicheck: return proper error code on check fail In-Reply-To: <20180810133636.8340-1-efremov@linux.com> Message-ID: References: <20180810133636.8340-1-efremov@linux.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 10 Aug 2018, efremov@linux.com wrote: > If coccicheck finds errors, What do you mean by finds errors? Do you mean that there is an error in the behavior of coccicheck or that coccicheck finds an error in the source code? To put it another way, can you give an example of the kind of error you are concerned about? thanks, julia > it should return an error code > distinct from zero. Current code instead of exiting with an > error code of coccinelle returns error code of > 'echo "coccicheck failed"' which is almost always equals to zero, > thus failing original intention of alerting about errors. > This patch fixes the problem. > > Found by Linux Driver Verification project (linuxtesting.org). > > Signed-off-by: Denis Efremov > --- > scripts/coccicheck | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/scripts/coccicheck b/scripts/coccicheck > index 9fedca611b7f..e04d328210ac 100755 > --- a/scripts/coccicheck > +++ b/scripts/coccicheck > @@ -128,9 +128,10 @@ run_cmd_parmap() { > fi > echo $@ >>$DEBUG_FILE > $@ 2>>$DEBUG_FILE > - if [[ $? -ne 0 ]]; then > + err=$? > + if [[ $err -ne 0 ]]; then > echo "coccicheck failed" > - exit $? > + exit $err > fi > } > > -- > 2.17.1 > >