Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp763847ybk; Fri, 15 May 2020 12:54:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrYwGPlEOleKMjeoLj6iaHQ9UawTQEUkwEHpW9mzZTt7p34hrk4jty3aPQoOKOwxT4Yvqy X-Received: by 2002:a05:6402:5:: with SMTP id d5mr4544877edu.247.1589572488502; Fri, 15 May 2020 12:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589572488; cv=none; d=google.com; s=arc-20160816; b=dt/Dk3cDM49BHXhksl/Fp074o7ugRL56PGp9tuX1d/8aEJM6z4VcAuUK9gfnoTFYBT 2vg5Da/k39PqjJBVE17tg62Sx0Eq3TOjpkB5zGxpf8dHihrT8X/zaYL7qBxPoCiJ5XEl Fz9xXr+inQCNFO6xHblDiD65mm+VN8FA0A6+OIVmR4mifpdnsNmKGSsMeYRz/+6m7z/Y 3RVuG5jBRLsEMN4pKBN4kv4k/unq9PQRNhRih4g6V8vWPauR0lAt/S6XBf56yifA4Yyh Jpsr8EwC71SWvh8CZxnzZwxctaLBE9uk6SNIBBEcrY+X0hPcUK5gw559PV9IXswStNY6 cbSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Z6AtkIfZfwO3h4rCiDNSDBqvPFpFjsjuSQdMEPZGAiU=; b=xHuu1LMHKlc3ZrRsr6tqaAbxCZ6v9OzVKLCg+y4zF3DrW3sP4xpCWCN+IMV8fvCxSH 0jVDYAE6giXPI1eJgI6qOFSBYOGIUsrH/5pLZmBMMRSpPQ0/vjf+CmXwUYQktBrGQwEd iHEN8thiUnYx4yhck79tS7Bg3u29FmvTab/cByxD9mbWP7OrWt+75dW/HKfgVHwfMOhV 2yLgjgOX7GAbb/d2hYwxTPisSlFtEiOh4MJs01wrOZGsRIAwieBmIbbFI9MgwYmj9+KW PMEP79SJitJZLxA5U59c72sYUCuBDqHQGNDmjVZQq5Px/WOnuOfrqS94WCGiPmLdPV8v sZyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=c2iG1OnW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t17si1937550ejo.25.2020.05.15.12.54.24; Fri, 15 May 2020 12:54:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=c2iG1OnW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726541AbgEOTxC (ORCPT + 99 others); Fri, 15 May 2020 15:53:02 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:58911 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726212AbgEOTxC (ORCPT ); Fri, 15 May 2020 15:53:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589572381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Z6AtkIfZfwO3h4rCiDNSDBqvPFpFjsjuSQdMEPZGAiU=; b=c2iG1OnWVrhd6uLkoDqSedqLWVYBlywHC7B8A2DdQK0/shy0bNPKbaJ1SXLAbl9zaeEePg uXUpelaJikiZitUvA+bbBpL4t9e+qJ5m9XcNb1AyftObyVvKMUxTCrvTYqUbgKdDAP4w6U kWWJvEO3pzf0lcRjnpN7KRICTY6UrVM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-321-bw0FVL25PkuyET2ad0mJbg-1; Fri, 15 May 2020 15:52:57 -0400 X-MC-Unique: bw0FVL25PkuyET2ad0mJbg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EBEEE100A614; Fri, 15 May 2020 19:52:55 +0000 (UTC) Received: from treble (ovpn-117-151.rdu2.redhat.com [10.10.117.151]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 19A016E9E2; Fri, 15 May 2020 19:52:54 +0000 (UTC) Date: Fri, 15 May 2020 14:52:53 -0500 From: Josh Poimboeuf To: Matt Helsley Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Julien Thierry , Miroslav Benes , Steven Rostedt Subject: Re: [RFC][PATCH 1/5] objtool: Exit successfully when requesting help Message-ID: <20200515195253.c5yzjyigxzhjflsd@treble> References: <10618c5e40b34a6af62c183feb5cd474c95e06fa.1588888003.git.mhelsley@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <10618c5e40b34a6af62c183feb5cd474c95e06fa.1588888003.git.mhelsley@vmware.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 11, 2020 at 10:35:09AM -0700, Matt Helsley wrote: > When the user requests help it's not an error so do not exit with > a non-zero exit code. This is not especially useful for a user but > any script that might wish to check that objtool --help is at least > available can't rely on the exit code to crudely check that, for > example building an objtool executable succeeds. > > Signed-off-by: Matt Helsley > --- > tools/objtool/objtool.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/tools/objtool/objtool.c b/tools/objtool/objtool.c > index 0b3528f05053..593ec85915a9 100644 > --- a/tools/objtool/objtool.c > +++ b/tools/objtool/objtool.c > @@ -58,7 +58,10 @@ static void cmd_usage(void) > > printf("\n"); > > - exit(129); > + if (!help) > + exit(129); > + else > + exit(0); Looks fine, though the 'else' isn't needed. -- Josh