public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] EDAC: Simplify return statement in dct_ecc_enabled()
@ 2025-02-01 13:09 Thorsten Blum
  2025-02-04 16:53 ` Yazen Ghannam
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Thorsten Blum @ 2025-02-01 13:09 UTC (permalink / raw)
  To: Yazen Ghannam, Borislav Petkov, Tony Luck, James Morse,
	Mauro Carvalho Chehab, Robert Richter
  Cc: Thorsten Blum, linux-edac, linux-kernel

Simplify the return statement to improve the code's readability.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/edac/amd64_edac.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 8414ceb43e4a..1f106b4fafdf 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -3355,10 +3355,7 @@ static bool dct_ecc_enabled(struct amd64_pvt *pvt)
 
 	edac_dbg(3, "Node %d: DRAM ECC %s.\n", nid, (ecc_en ? "enabled" : "disabled"));
 
-	if (!ecc_en || !nb_mce_en)
-		return false;
-	else
-		return true;
+	return ecc_en && nb_mce_en;
 }
 
 static bool umc_ecc_enabled(struct amd64_pvt *pvt)
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] EDAC: Simplify return statement in dct_ecc_enabled()
  2025-02-01 13:09 [PATCH] EDAC: Simplify return statement in dct_ecc_enabled() Thorsten Blum
@ 2025-02-04 16:53 ` Yazen Ghannam
  2025-02-05 12:00 ` Zhuo, Qiuxu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Yazen Ghannam @ 2025-02-04 16:53 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Borislav Petkov, Tony Luck, James Morse, Mauro Carvalho Chehab,
	Robert Richter, linux-edac, linux-kernel

On Sat, Feb 01, 2025 at 02:09:54PM +0100, Thorsten Blum wrote:
> Simplify the return statement to improve the code's readability.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>  drivers/edac/amd64_edac.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
> index 8414ceb43e4a..1f106b4fafdf 100644
> --- a/drivers/edac/amd64_edac.c
> +++ b/drivers/edac/amd64_edac.c
> @@ -3355,10 +3355,7 @@ static bool dct_ecc_enabled(struct amd64_pvt *pvt)
>  
>  	edac_dbg(3, "Node %d: DRAM ECC %s.\n", nid, (ecc_en ? "enabled" : "disabled"));
>  
> -	if (!ecc_en || !nb_mce_en)
> -		return false;
> -	else
> -		return true;
> +	return ecc_en && nb_mce_en;
>  }
>  
>  static bool umc_ecc_enabled(struct amd64_pvt *pvt)
> -- 

Looks good to me.

Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>

Thanks,
Yazen

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] EDAC: Simplify return statement in dct_ecc_enabled()
  2025-02-01 13:09 [PATCH] EDAC: Simplify return statement in dct_ecc_enabled() Thorsten Blum
  2025-02-04 16:53 ` Yazen Ghannam
@ 2025-02-05 12:00 ` Zhuo, Qiuxu
  2025-02-24  9:58 ` [RESEND PATCH] " Thorsten Blum
  2025-02-28 12:30 ` [PATCH] " Borislav Petkov
  3 siblings, 0 replies; 5+ messages in thread
From: Zhuo, Qiuxu @ 2025-02-05 12:00 UTC (permalink / raw)
  To: Thorsten Blum, Yazen Ghannam, Borislav Petkov, Luck, Tony,
	James Morse, Mauro Carvalho Chehab, Robert Richter
  Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org

> From: Thorsten Blum <thorsten.blum@linux.dev>
> [...]
> Subject: [PATCH] EDAC: Simplify return statement in dct_ecc_enabled()
> 
> Simplify the return statement to improve the code's readability.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>  drivers/edac/amd64_edac.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index
> 8414ceb43e4a..1f106b4fafdf 100644
> --- a/drivers/edac/amd64_edac.c
> +++ b/drivers/edac/amd64_edac.c
> @@ -3355,10 +3355,7 @@ static bool dct_ecc_enabled(struct amd64_pvt
> *pvt)
> 
>  	edac_dbg(3, "Node %d: DRAM ECC %s.\n", nid, (ecc_en ? "enabled" :
> "disabled"));
> 
> -	if (!ecc_en || !nb_mce_en)
> -		return false;
> -	else
> -		return true;
> +	return ecc_en && nb_mce_en;
>  }

LGTM. Thanks!

   Reviewed-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RESEND PATCH] EDAC: Simplify return statement in dct_ecc_enabled()
  2025-02-01 13:09 [PATCH] EDAC: Simplify return statement in dct_ecc_enabled() Thorsten Blum
  2025-02-04 16:53 ` Yazen Ghannam
  2025-02-05 12:00 ` Zhuo, Qiuxu
@ 2025-02-24  9:58 ` Thorsten Blum
  2025-02-28 12:30 ` [PATCH] " Borislav Petkov
  3 siblings, 0 replies; 5+ messages in thread
From: Thorsten Blum @ 2025-02-24  9:58 UTC (permalink / raw)
  To: Yazen Ghannam, Borislav Petkov, Tony Luck, James Morse,
	Mauro Carvalho Chehab, Robert Richter
  Cc: Thorsten Blum, Qiuxu Zhuo, linux-edac, linux-kernel

Simplify the return statement to improve the code's readability.

Reviewed-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/edac/amd64_edac.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 8414ceb43e4a..1f106b4fafdf 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -3355,10 +3355,7 @@ static bool dct_ecc_enabled(struct amd64_pvt *pvt)
 
 	edac_dbg(3, "Node %d: DRAM ECC %s.\n", nid, (ecc_en ? "enabled" : "disabled"));
 
-	if (!ecc_en || !nb_mce_en)
-		return false;
-	else
-		return true;
+	return ecc_en && nb_mce_en;
 }
 
 static bool umc_ecc_enabled(struct amd64_pvt *pvt)
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] EDAC: Simplify return statement in dct_ecc_enabled()
  2025-02-01 13:09 [PATCH] EDAC: Simplify return statement in dct_ecc_enabled() Thorsten Blum
                   ` (2 preceding siblings ...)
  2025-02-24  9:58 ` [RESEND PATCH] " Thorsten Blum
@ 2025-02-28 12:30 ` Borislav Petkov
  3 siblings, 0 replies; 5+ messages in thread
From: Borislav Petkov @ 2025-02-28 12:30 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Yazen Ghannam, Tony Luck, James Morse, Mauro Carvalho Chehab,
	Robert Richter, linux-edac, linux-kernel

On Sat, Feb 01, 2025 at 02:09:54PM +0100, Thorsten Blum wrote:
> Simplify the return statement to improve the code's readability.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>  drivers/edac/amd64_edac.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
> index 8414ceb43e4a..1f106b4fafdf 100644
> --- a/drivers/edac/amd64_edac.c
> +++ b/drivers/edac/amd64_edac.c
> @@ -3355,10 +3355,7 @@ static bool dct_ecc_enabled(struct amd64_pvt *pvt)
>  
>  	edac_dbg(3, "Node %d: DRAM ECC %s.\n", nid, (ecc_en ? "enabled" : "disabled"));
>  
> -	if (!ecc_en || !nb_mce_en)
> -		return false;
> -	else
> -		return true;
> +	return ecc_en && nb_mce_en;
>  }
>  
>  static bool umc_ecc_enabled(struct amd64_pvt *pvt)
> -- 

Applied, thanks.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-02-28 12:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-01 13:09 [PATCH] EDAC: Simplify return statement in dct_ecc_enabled() Thorsten Blum
2025-02-04 16:53 ` Yazen Ghannam
2025-02-05 12:00 ` Zhuo, Qiuxu
2025-02-24  9:58 ` [RESEND PATCH] " Thorsten Blum
2025-02-28 12:30 ` [PATCH] " Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox