From: Thorsten Blum <thorsten.blum@linux.dev>
To: Yazen Ghannam <yazen.ghannam@amd.com>,
Borislav Petkov <bp@alien8.de>, Tony Luck <tony.luck@intel.com>,
James Morse <james.morse@arm.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Robert Richter <rric@kernel.org>
Cc: Thorsten Blum <thorsten.blum@linux.dev>,
linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] EDAC: Simplify return statement in dct_ecc_enabled()
Date: Sat, 1 Feb 2025 14:09:54 +0100 [thread overview]
Message-ID: <20250201130953.1377-2-thorsten.blum@linux.dev> (raw)
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
WARNING: multiple messages have this Message-ID (diff)
From: Thorsten Blum <thorsten.blum@linux.dev>
To: Yazen Ghannam <yazen.ghannam@amd.com>,
Borislav Petkov <bp@alien8.de>, Tony Luck <tony.luck@intel.com>,
James Morse <james.morse@arm.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Robert Richter <rric@kernel.org>
Cc: Thorsten Blum <thorsten.blum@linux.dev>,
Qiuxu Zhuo <qiuxu.zhuo@intel.com>,
linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [RESEND PATCH] EDAC: Simplify return statement in dct_ecc_enabled()
Date: Mon, 24 Feb 2025 10:58:19 +0100 [thread overview]
Message-ID: <20250201130953.1377-2-thorsten.blum@linux.dev> (raw)
Message-ID: <20250224095819.quuAtugC4yCtErAJn-bXnbwPSAQI5d6dwMBTzQLLb4U@z> (raw)
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
next reply other threads:[~2025-02-01 13:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-01 13:09 Thorsten Blum [this message]
2025-02-24 9:58 ` [RESEND PATCH] EDAC: Simplify return statement in dct_ecc_enabled() Thorsten Blum
2025-02-04 16:53 ` [PATCH] " Yazen Ghannam
2025-02-05 12:00 ` Zhuo, Qiuxu
2025-02-28 12:30 ` Borislav Petkov
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=20250201130953.1377-2-thorsten.blum@linux.dev \
--to=thorsten.blum@linux.dev \
--cc=bp@alien8.de \
--cc=james.morse@arm.com \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=rric@kernel.org \
--cc=tony.luck@intel.com \
--cc=yazen.ghannam@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.