From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id AFA6E38582AE for ; Thu, 4 Aug 2022 17:10:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AFA6E38582AE Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 274H9g0x027032; Thu, 4 Aug 2022 12:09:42 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 274H9fH0027031; Thu, 4 Aug 2022 12:09:41 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 4 Aug 2022 12:09:41 -0500 From: Segher Boessenkool To: HAO CHEN GUI Cc: gcc-patches , David , "Kewen.Lin" , Peter Bergner Subject: Re: [PATCH, rs6000] Correct return value of check_p9modulo_hw_available Message-ID: <20220804170941.GM25951@gate.crashing.org> References: <315e43e5-3167-50de-08ec-ab83202e55a0@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <315e43e5-3167-50de-08ec-ab83202e55a0@linux.ibm.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2022 17:10:44 -0000 Hi! On Thu, Aug 04, 2022 at 05:55:20PM +0800, HAO CHEN GUI wrote: > This patch corrects return value of check_p9modulo_hw_available. It should > return 0 when p9modulo is supported. It would be harder to make such mistakes if it used exit() explicitly, so that the reader is reminded the shell semantics are used here instead of the C conventions. > - return (r == 2); > + return (r != 2); so that then would be smth like if (r == 2) exit (0); else exit (1); (which makes the exit code for failure explicit as well). Terse is good. Explicit is good as well :-) (You don't have to make this change here of course, but keep it in mind for the future :-) ) Segher