[PATCH] EDAC: Init minimum possible error desc grain

From: Vasyl Gomonovych
Date: Wed Apr 20 2022 - 16:07:47 EST


Initialize the raw error descriptor after
zeroing to a minimum possible value 1.
It is safe for DIMM and not DIMM-based
systems and does not provide a useless
verification print.

Signed-off-by: Vasyl Gomonovych <vgomonovych@xxxxxxxxxxx>
---
drivers/edac/edac_mc.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index d2715774af6fb3a0b07ff2c6ce6bb510091c0a68..a985f9a0b89b466934d1c167bdb243687fbfd093 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -990,10 +990,6 @@ void edac_raw_mc_handle_error(struct edac_raw_error_desc *e)
struct mem_ctl_info *mci = error_desc_to_mci(e);
u8 grain_bits;

- /* Sanity-check driver-supplied grain value. */
- if (WARN_ON_ONCE(!e->grain))
- e->grain = 1;
-
grain_bits = fls_long(e->grain - 1);

/* Report the error via the trace interface */
@@ -1047,6 +1043,7 @@ void edac_mc_handle_error(const enum hw_event_mc_err_type type,
/* need valid strings here for both: */
e->msg = msg ?: "";
e->other_detail = other_detail ?: "";
+ e->grain = 1;

/*
* Check if the event report is consistent and if the memory location is
--
2.17.1