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 <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70374
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
This commit is contained in:
Elyes Haouas 2022-12-05 18:49:40 +01:00 committed by Felix Singer
parent e03d312a2c
commit 3a54f4a7f1

View File

@ -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
// NC/{8,16}SS
s->dimm_config[chan] = 1;
} else {
// NC/16SS
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
// {8,16}SS/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) {
@ -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
// {8,16}SS/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
@ -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");
}
} else {
if (s->dimms[(chan>>1) + 1].width == 0) {
die("Mixed Not supported\n");