Skip to contentSkip to conversation

EDAC: Init minimum possible error desc grain

PATCH New Vasyl Gomonovych 1 participant 1 message Apr 20, 2022 EDAC-core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 EDAC: Init minimum possible error desc grain

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.

---
 drivers/edac/edac_mc.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/edac/edac_mc.c +1 -4
index d2715774af6fb3a0b07ff2c6ce6bb510091c0a68..a985f9a0b89b466934d1c167bdb243687fbfd093 100644
@@ -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
Signature · 1 line
2.17.1