mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
sb/amd/sb700/lpc.c: Optimize code flow for less indentation
This changes the code flow so less indentation has to be used. This also changes some lines to limit their length. Change-Id: I50ca99a759a276e9d49327c6ae6c69eeab2a8c90 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/21234 Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
6af8aab539
commit
0315b6740a
1 changed files with 74 additions and 72 deletions
|
@ -144,8 +144,10 @@ static void sb700_lpc_enable_childrens_resources(device_t dev)
|
|||
device_t child;
|
||||
for (child = link->children; child;
|
||||
child = child->sibling) {
|
||||
if (child->enabled
|
||||
&& (child->path.type == DEVICE_PATH_PNP)) {
|
||||
if (!(child->enabled
|
||||
&& (child->path.type == DEVICE_PATH_PNP)))
|
||||
continue;
|
||||
|
||||
struct resource *res;
|
||||
for (res = child->resource_list; res; res = res->next) {
|
||||
u32 base, end; /* don't need long long */
|
||||
|
@ -153,7 +155,8 @@ static void sb700_lpc_enable_childrens_resources(device_t dev)
|
|||
continue;
|
||||
base = res->base;
|
||||
end = resource_end(res);
|
||||
printk(BIOS_DEBUG, "sb700 lpc decode:%s, base=0x%08x, end=0x%08x\n",
|
||||
printk(BIOS_DEBUG, "sb700 lpc decode:%s,"
|
||||
" base=0x%08x, end=0x%08x\n",
|
||||
dev_path(child), base, end);
|
||||
switch (base) {
|
||||
case 0x60: /* KB */
|
||||
|
@ -198,8 +201,9 @@ static void sb700_lpc_enable_childrens_resources(device_t dev)
|
|||
reg_x |= (1 << 23);
|
||||
break;
|
||||
default:
|
||||
/* only 3 var ; compact them ? */
|
||||
if (var_num >= 3)
|
||||
continue; /* only 3 var ; compact them ? */
|
||||
continue;
|
||||
switch (var_num) {
|
||||
case 0:
|
||||
reg_x |= (1 << 2);
|
||||
|
@ -218,9 +222,7 @@ static void sb700_lpc_enable_childrens_resources(device_t dev)
|
|||
wiosize |= (1 << 3);
|
||||
break;
|
||||
}
|
||||
reg_var[var_num++] =
|
||||
base & 0xffff;
|
||||
}
|
||||
reg_var[var_num++] = base & 0xffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue