mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
To: Thorsten Blum <thorsten.blum@linux.dev>,
	"David S. Miller" <davem@davemloft.net>,
	Andreas Larsson <andreas@gaisler.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Sam Ravnborg <sam@ravnborg.org>, Dawei Li <dawei.li@shingroup.cn>
Cc: sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sparc/irq: Remove unneeded if check in sun4v_cookie_only_virqs()
Date: Tue, 14 Jan 2025 21:29:45 +0100	[thread overview]
Message-ID: <2b249bb11b3c08b21929b46f14bee808c9bbefe6.camel@physik.fu-berlin.de> (raw)
In-Reply-To: <20250114202502.912690-1-thorsten.blum@linux.dev>

Hi Thorsten,

On Tue, 2025-01-14 at 21:25 +0100, Thorsten Blum wrote:
> Remove the unnecessary if check and return the result directly.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>  arch/sparc/kernel/irq_64.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c
> index aff0d24f8c6f..81fb49b089a8 100644
> --- a/arch/sparc/kernel/irq_64.c
> +++ b/arch/sparc/kernel/irq_64.c
> @@ -146,9 +146,7 @@ static int hv_irq_version;
>   */
>  static bool sun4v_cookie_only_virqs(void)
>  {
> -	if (hv_irq_version >= 3)
> -		return true;
> -	return false;
> +	return hv_irq_version >= 3;
>  }
>  
>  static void __init irq_init_hv(void)

I'm not sure whether this change is really necessary nor will it improve
the readability of the code. I think the compiler will optimize the code
the same way, for both variants.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

  reply	other threads:[~2025-01-14 20:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-14 20:25 Thorsten Blum
2025-01-14 20:29 ` John Paul Adrian Glaubitz [this message]
2025-01-15 16:11   ` Thorsten Blum
2025-01-17 15:21     ` Andreas Larsson

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=2b249bb11b3c08b21929b46f14bee808c9bbefe6.camel@physik.fu-berlin.de \
    --to=glaubitz@physik.fu-berlin.de \
    --cc=andreas@gaisler.com \
    --cc=bhelgaas@google.com \
    --cc=davem@davemloft.net \
    --cc=dawei.li@shingroup.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=sam@ravnborg.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=thorsten.blum@linux.dev \
    /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

all inboxes | Powered by JetHome®