public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: HAO CHEN GUI <guihaoc@linux.ibm.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>, David <dje.gcc@gmail.com>,
	"Kewen.Lin" <linkw@linux.ibm.com>,
	Peter Bergner <bergner@linux.ibm.com>
Subject: Re: [PATCH, rs6000] Correct return value of check_p9modulo_hw_available
Date: Thu, 4 Aug 2022 12:09:41 -0500	[thread overview]
Message-ID: <20220804170941.GM25951@gate.crashing.org> (raw)
In-Reply-To: <315e43e5-3167-50de-08ec-ab83202e55a0@linux.ibm.com>

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

  parent reply	other threads:[~2022-08-04 17:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-04  9:55 HAO CHEN GUI
2022-08-04 11:12 ` Kewen.Lin
2022-08-04 17:09 ` Segher Boessenkool [this message]
2022-08-05  3:05   ` HAO CHEN GUI

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220804170941.GM25951@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=bergner@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=guihaoc@linux.ibm.com \
    --cc=linkw@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).