HAOUAS Elyes has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/40429 )
Change subject: src/northbridge/intel: Drop duplicated branches ......................................................................
src/northbridge/intel: Drop duplicated branches
Duplicated branches found using '-Wduplicated-branches' warning option.
Change-Id: If6ac1be28be963bcdaaf3d94e13b4f7917ed8e7c Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- M src/northbridge/intel/pineview/raminit.c M src/northbridge/intel/sandybridge/gma.c 2 files changed, 28 insertions(+), 28 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/29/40429/1
diff --git a/src/northbridge/intel/pineview/raminit.c b/src/northbridge/intel/pineview/raminit.c index 18e1faa..1855119 100644 --- a/src/northbridge/intel/pineview/raminit.c +++ b/src/northbridge/intel/pineview/raminit.c @@ -162,13 +162,13 @@ s->dimm_config[chan] = 0; } else if (s->dimms[(chan>>1) + 1].sides == 1) { // NC/SS - if (s->dimms[(chan>>1) + 1].width == 0) { + //if (s->dimms[(chan>>1) + 1].width == 0) { // NC/8SS - s->dimm_config[chan] = 1; - } else { + // s->dimm_config[chan] = 1; + //} else { // NC/16SS s->dimm_config[chan] = 1; - } + //} } else { // NC/DS if (s->dimms[(chan>>1) + 1].width == 0) { @@ -183,13 +183,13 @@ // SS if (s->dimms[(chan>>1) + 1].sides == 0) { // SS/NC - if (s->dimms[chan>>1].width == 0) { + //if (s->dimms[chan>>1].width == 0) { // 8SS/NC - s->dimm_config[chan] = 1; - } else { + // s->dimm_config[chan] = 1; + //} else { // 16SS/NC s->dimm_config[chan] = 1; - } + //} } else if (s->dimms[(chan>>1) + 1].sides == 1) { // SS/SS if (s->dimms[chan>>1].width == 0) { @@ -211,21 +211,21 @@ } } else { // SS/DS - if (s->dimms[chan>>1].width == 0) { - if (s->dimms[(chan>>1) + 1].width == 0) { + //if (s->dimms[chan>>1].width == 0) { + //if (s->dimms[(chan>>1) + 1].width == 0) { // 8SS/8DS - die("Mixed Not supported\n"); - } else { - die("Mixed Not supported\n"); - } - } else { - if (s->dimms[(chan>>1) + 1].width == 0) { + // die("Mixed Not supported\n"); + //} else { + // die("Mixed Not supported\n"); + //} + //} else { + //if (s->dimms[(chan>>1) + 1].width == 0) { // 16SS/8DS + // die("Mixed Not supported\n"); + //} else { die("Mixed Not supported\n"); - } else { - die("Mixed Not supported\n"); - } - } + //} + //} } } else { // DS @@ -240,13 +240,13 @@ } else if (s->dimms[(chan>>1) + 1].sides == 1) { // DS/SS if (s->dimms[chan>>1].width == 0) { - if (s->dimms[(chan>>1) + 1].width == 0) { + //if (s->dimms[(chan>>1) + 1].width == 0) { // 8DS/8SS - die("Mixed Not supported\n"); - } else { + // die("Mixed Not supported\n"); + //} else { // 8DS/16SS die("Mixed Not supported\n"); - } + //} } else { if (s->dimms[(chan>>1) + 1].width == 0) { die("Mixed Not supported\n"); diff --git a/src/northbridge/intel/sandybridge/gma.c b/src/northbridge/intel/sandybridge/gma.c index 5c4f548..30230f5 100644 --- a/src/northbridge/intel/sandybridge/gma.c +++ b/src/northbridge/intel/sandybridge/gma.c @@ -470,17 +470,17 @@ gtt_write(0xa070, 0x0000000a); /* RP Idle Hysteresis */
/* 11a: Enable Render Standby (RC6) */ - if ((bridge_silicon_revision() & BASE_REV_MASK) == BASE_REV_IVB) { + //if ((bridge_silicon_revision() & BASE_REV_MASK) == BASE_REV_IVB) { /* * IvyBridge should also support DeepRenderStandby. * * Unfortunately it does not work reliably on all SKUs so * disable it here and it can be enabled by the kernel. */ + // gtt_write(0xa090, 0x88040000); /* HW RC Control */ + //} else { gtt_write(0xa090, 0x88040000); /* HW RC Control */ - } else { - gtt_write(0xa090, 0x88040000); /* HW RC Control */ - } + //}
/* 12: Normal Frequency Request */ /* RPNFREQ_VAL comes from MCHBAR 0x5998 23:16 */
HAOUAS Elyes has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/40429 )
Change subject: src/northbridge/intel: Drop duplicated branches ......................................................................
Abandoned
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40429 )
Change subject: src/northbridge/intel: Drop duplicated branches ......................................................................
Patch Set 3:
Angel, Arthur, any idea regarding the Pineview code?
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40429 )
Change subject: src/northbridge/intel: Drop duplicated branches ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/40429/3/src/northbridge/intel/pinev... File src/northbridge/intel/pineview/raminit.c:
https://review.coreboot.org/c/coreboot/+/40429/3/src/northbridge/intel/pinev... PS3, Line 158: if (s->dimms[chan>>1].sides == 0) { : // NC : if (s->dimms[(chan>>1) + 1].sides == 0) { : // NC/NC : s->dimm_config[chan] = 0; : } else if (s->dimms[(chan>>1) + 1].sides == 1) { : // NC/SS : //if (s->dimms[(chan>>1) + 1].width == 0) { : // NC/8SS : // s->dimm_config[chan] = 1; : //} else { : // NC/16SS : s->dimm_config[chan] = 1; : //} : } else { : // NC/DS : if (s->dimms[(chan>>1) + 1].width == 0) { : // NC/8DS : s->dimm_config[chan] = 5; : } else { : // NC/16DS : s->dimm_config[chan] = 2; : } : } : } else if (s->dimms[chan>>1].sides == 1) { : // SS : if (s->dimms[(chan>>1) + 1].sides == 0) { : // SS/NC : //if (s->dimms[chan>>1].width == 0) { : // 8SS/NC : // s->dimm_config[chan] = 1; : //} else { : // 16SS/NC : s->dimm_config[chan] = 1; : //} : } else if (s->dimms[(chan>>1) + 1].sides == 1) { : // SS/SS : if (s->dimms[chan>>1].width == 0) { : if (s->dimms[(chan>>1) + 1].width == 0) { : // 8SS/8SS : s->dimm_config[chan] = 3; : } else { : // 8SS/16SS : die("Mixed Not supported\n"); : } : } else { : if (s->dimms[(chan>>1) + 1].width == 0) { : // 16SS/8SS : die("Mixed Not supported\n"); : } else { : // 16SS/16SS : s->dimm_config[chan] = 3; : } : } : } else { : // SS/DS : //if (s->dimms[chan>>1].width == 0) { : //if (s->dimms[(chan>>1) + 1].width == 0) { : // 8SS/8DS : // die("Mixed Not supported\n"); : //} else { : // die("Mixed Not supported\n"); : //} : //} else { : //if (s->dimms[(chan>>1) + 1].width == 0) { : // 16SS/8DS : // die("Mixed Not supported\n"); : //} else { : die("Mixed Not supported\n"); : //} : //} : } : } else { : // DS : if (s->dimms[(chan>>1) + 1].sides == 0) { : // DS/NC : if (s->dimms[chan>>1].width == 0) { : // 8DS/NC : s->dimm_config[chan] = 5; : } else { : s->dimm_config[chan] = 4; : } : } else if (s->dimms[(chan>>1) + 1].sides == 1) { : // DS/SS : if (s->dimms[chan>>1].width == 0) { : //if (s->dimms[(chan>>1) + 1].width == 0) { : // 8DS/8SS : // die("Mixed Not supported\n"); : //} else { : // 8DS/16SS : die("Mixed Not supported\n"); : //} : } else { : if (s->dimms[(chan>>1) + 1].width == 0) { : die("Mixed Not supported\n"); : } else { : // 16DS/16DS : s->dimm_config[chan] = 4; : } : } : } else { : // DS/DS : if (s->dimms[chan>>1].width == 0 && s->dimms[(chan>>1)+1].width == 0) { : // 8DS/8DS : s->dimm_config[chan] = 6; : } : } : } This whole part is quite hard to read in general and should probably be refactored...