From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68A3D2F83CB for ; Wed, 18 Mar 2026 17:55:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773856516; cv=none; b=Bt3k1GPRKp1SBJxt879ZhKjUHvpIFsSeMBaf+SAtdwjovfYj5LuPHlPnYv/CIx7Sf7IlRrnb3ERHn4kLAwR/ftTix+L2bdvU3GBmNprLBSxWJVHO757lhVE9PwUg8BwJei/7iXF0FaacgND4RRrI8VE6ZzyyYgMMwjGGVbAsWBQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773856516; c=relaxed/simple; bh=xjgZRNo5+O4LtOpupgn/WwWGDTsuDI9ZOECeG4dueCs=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=rvu1I6+p4DAd/3QdryYjv5bkZidSI+hZ2GH73pQ28vGfQnVM1+v+W5KdgS5RJ00v6zkIbpwt12AP/BMUMhbmWWt30etUUCuwjfwUUviQDCZxk1WlyJDZ04Lh28svDCBIbK7twEHsVVdSxv7e/qgNtO0fM1EZkOW3W2YRwZQKOCA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=H1cDmr0Y; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="H1cDmr0Y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE51DC19421; Wed, 18 Mar 2026 17:55:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1773856516; bh=xjgZRNo5+O4LtOpupgn/WwWGDTsuDI9ZOECeG4dueCs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=H1cDmr0Yso4C1ex512rp44J16KrGS0NeerCD39GdMThjFVYr42ivY5E9BbcgAg+38 pwDqwxb7rftwEQOg56UK9bloC9ov9pSWsGtdpn5/2xvyt9arUJ/vMs/IfxWB9dnK8T QFPkmsPY0+8Go/8UkurOMhjetiHoYZ8Yt/WR8ggU= Date: Wed, 18 Mar 2026 10:55:15 -0700 From: Andrew Morton To: Patrick Bellasi Cc: linux-kernel@vger.kernel.org, Randy Dunlap Subject: Re: [PATCH] scripts/decodecode: Return 0 on success Message-Id: <20260318105515.427ebf799e9ddd1115e3f412@linux-foundation.org> In-Reply-To: <20260318150545.2809311-1-derkling@google.com> References: <20260318150545.2809311-1-derkling@google.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 18 Mar 2026 15:05:45 +0000 Patrick Bellasi wrote: > The decodecode script always returns an exit code of 1, regardless of > whether the operation was successful or not. This is because the > "cleanup" function, which is registered to run on any script exit via > "trap cleanup EXIT", contains an unconditional "exit 1". > > Remove the "exit 1" from the "cleanup" function so that it only performs > the necessary file cleanup without forcing a non-zero exit status. > > Do that to ensure successful script executions now exit with code 0. > Exits due to errors are all handled by the "die()" function and will > still correctly exit with code 1. > > ... > > --- a/scripts/decodecode > +++ b/scripts/decodecode > @@ -12,7 +12,6 @@ faultlinenum=1 > > cleanup() { > rm -f $T $T.s $T.o $T.oo $T.aa $T.dis > - exit 1 > } > > die() { > @@ -49,7 +48,7 @@ done > > if [ -z "$code" ]; then > rm $T > - exit > + die "Code line not found" > fi > > echo $code Seems reasonable. Randy added this in 2008 - I'm sure he can remember why ;)