From 3a54f4a7f15dc14a0f70ba781b488d63f5b6238e Mon Sep 17 00:00:00 2001 From: Elyes Haouas Date: Mon, 5 Dec 2022 18:49:40 +0100 Subject: nb/intel/pineview/raminit.c: Get rid of duplicated branches Duplicated branches found using 'Wduplicated-branches' GCC flag. Change-Id: I252ea6aefb6d6c85135e640ba8deaa118be38f5e Signed-off-by: Elyes Haouas Reviewed-on: https://review.coreboot.org/c/coreboot/+/70374 Tested-by: build bot (Jenkins) Reviewed-by: Eric Lai Reviewed-by: Felix Singer --- src/northbridge/intel/pineview/raminit.c | 48 ++++++-------------------------- 1 file changed, 8 insertions(+), 40 deletions(-) (limited to 'src/northbridge/intel') diff --git a/src/northbridge/intel/pineview/raminit.c b/src/northbridge/intel/pineview/raminit.c index 3699173ea0..dbc373d1fb 100644 --- a/src/northbridge/intel/pineview/raminit.c +++ b/src/northbridge/intel/pineview/raminit.c @@ -149,14 +149,8 @@ static void find_ramconfig(struct sysinfo *s, u32 chan) // 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; - } + // NC/{8,16}SS + s->dimm_config[chan] = 1; } else { // NC/DS if (s->dimms[(chan>>1) + 1].width == 0) { @@ -170,14 +164,8 @@ static void find_ramconfig(struct sysinfo *s, u32 chan) } 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; - } + // {8,16}SS/NC + s->dimm_config[chan] = 1; } else if (s->dimms[(chan>>1) + 1].sides == 1) { // SS/SS if (s->dimms[chan>>1].width == 0) { @@ -198,22 +186,8 @@ static void find_ramconfig(struct sysinfo *s, u32 chan) } } } 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"); - } - } + // {8,16}SS/8DS + die("Mixed Not supported\n"); } } else { // DS @@ -226,15 +200,9 @@ static void find_ramconfig(struct sysinfo *s, u32 chan) s->dimm_config[chan] = 4; } } else if (s->dimms[(chan>>1) + 1].sides == 1) { - // DS/SS + // 8DS/{8,16}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"); - } + die("Mixed Not supported\n"); } else { if (s->dimms[(chan>>1) + 1].width == 0) { die("Mixed Not supported\n"); -- cgit v1.2.3