File tree Expand file tree Collapse file tree 1 file changed +10
-22
lines changed Expand file tree Collapse file tree 1 file changed +10
-22
lines changed Original file line number Diff line number Diff line change @@ -3363,36 +3363,24 @@ static bool dct_ecc_enabled(struct amd64_pvt *pvt)
33633363
33643364static bool umc_ecc_enabled (struct amd64_pvt * pvt )
33653365{
3366- u8 umc_en_mask = 0 , ecc_en_mask = 0 ;
3367- u16 nid = pvt -> mc_node_id ;
33683366 struct amd64_umc * umc ;
3369- u8 ecc_en = 0 , i ;
3367+ bool ecc_en = false;
3368+ int i ;
33703369
3370+ /* Check whether at least one UMC is enabled: */
33713371 for_each_umc (i ) {
33723372 umc = & pvt -> umc [i ];
33733373
3374- /* Only check enabled UMCs. */
3375- if (!(umc -> sdp_ctrl & UMC_SDP_INIT ))
3376- continue ;
3377-
3378- umc_en_mask |= BIT (i );
3379-
3380- if (umc -> umc_cap_hi & UMC_ECC_ENABLED )
3381- ecc_en_mask |= BIT (i );
3374+ if (umc -> sdp_ctrl & UMC_SDP_INIT &&
3375+ umc -> umc_cap_hi & UMC_ECC_ENABLED ) {
3376+ ecc_en = true;
3377+ break ;
3378+ }
33823379 }
33833380
3384- /* Check whether at least one UMC is enabled: */
3385- if (umc_en_mask )
3386- ecc_en = umc_en_mask == ecc_en_mask ;
3387- else
3388- edac_dbg (0 , "Node %d: No enabled UMCs.\n" , nid );
3389-
3390- edac_dbg (3 , "Node %d: DRAM ECC %s.\n" , nid , (ecc_en ? "enabled" : "disabled" ));
3381+ edac_dbg (3 , "Node %d: DRAM ECC %s.\n" , pvt -> mc_node_id , (ecc_en ? "enabled" : "disabled" ));
33913382
3392- if (!ecc_en )
3393- return false;
3394- else
3395- return true;
3383+ return ecc_en ;
33963384}
33973385
33983386static inline void
You can’t perform that action at this time.
0 commit comments