diff options
author | Elyes Haouas <ehaouas@noos.fr> | 2022-02-25 18:23:01 +0100 |
---|---|---|
committer | Martin L Roth <martinroth@google.com> | 2022-04-24 21:35:25 +0000 |
commit | 9d8df30950710635c9e7c099ef8d0c8d047658ca (patch) | |
tree | 3e8fff49857bc5edb5b9857a50df71fedc3cab65 /src/northbridge/amd/agesa | |
parent | 5213b193c7afb4d1790b2d1ed8d36a4b672dfef5 (diff) |
nb/amd/{agesa,pi}: Clean up some math expressions
Change-Id: Id6a1a6123dc0e2afd04213ece13363eed29f92c0
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55930
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Martin L Roth <martinroth@google.com>
Diffstat (limited to 'src/northbridge/amd/agesa')
-rw-r--r-- | src/northbridge/amd/agesa/family14/northbridge.c | 4 | ||||
-rw-r--r-- | src/northbridge/amd/agesa/family15tn/northbridge.c | 8 | ||||
-rw-r--r-- | src/northbridge/amd/agesa/family16kb/northbridge.c | 8 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/northbridge/amd/agesa/family14/northbridge.c b/src/northbridge/amd/agesa/family14/northbridge.c index e102252983..cf67d93551 100644 --- a/src/northbridge/amd/agesa/family14/northbridge.c +++ b/src/northbridge/amd/agesa/family14/northbridge.c @@ -552,12 +552,12 @@ static void domain_set_resources(struct device *dev) basek, limitk, sizek); /* See if we need a hole from 0xa0000 (640K) to 0xbffff (768K) */ - if ((basek < 640) && (sizek > 768)) { + if (basek < 640 && sizek > 768) { printk(BIOS_DEBUG,"adsr - 0xa0000 to 0xbffff resource.\n"); ram_resource(dev, (idx | 0), basek, 640 - basek); idx += 0x10; basek = 768; - sizek = limitk - 768; + sizek = limitk - basek; } printk(BIOS_DEBUG, diff --git a/src/northbridge/amd/agesa/family15tn/northbridge.c b/src/northbridge/amd/agesa/family15tn/northbridge.c index 8c010ee388..046f87576a 100644 --- a/src/northbridge/amd/agesa/family15tn/northbridge.c +++ b/src/northbridge/amd/agesa/family15tn/northbridge.c @@ -710,11 +710,11 @@ static void domain_set_resources(struct device *dev) sizek = limitk - basek; /* See if we need a hole from 0xa0000 (640K) to 0xbffff (768K) */ - if ((basek < ((8*64)+(8*16))) && (sizek > ((8*64)+(16*16)))) { - ram_resource(dev, (idx | i), basek, ((8*64)+(8*16)) - basek); + if (basek < 640 && sizek > 768) { + ram_resource(dev, (idx | i), basek, 640 - basek); idx += 0x10; - basek = (8*64)+(16*16); - sizek = limitk - ((8*64)+(16*16)); + basek = 768; + sizek = limitk - basek; } diff --git a/src/northbridge/amd/agesa/family16kb/northbridge.c b/src/northbridge/amd/agesa/family16kb/northbridge.c index a343321808..0dc3d0bcae 100644 --- a/src/northbridge/amd/agesa/family16kb/northbridge.c +++ b/src/northbridge/amd/agesa/family16kb/northbridge.c @@ -722,11 +722,11 @@ static void domain_set_resources(struct device *dev) sizek = limitk - basek; /* See if we need a hole from 0xa0000 (640K) to 0xbffff (768K) */ - if ((basek < ((8*64)+(8*16))) && (sizek > ((8*64)+(16*16)))) { - ram_resource(dev, (idx | i), basek, ((8*64)+(8*16)) - basek); + if (basek < 640 && sizek > 768) { + ram_resource(dev, (idx | i), basek, 640 - basek); idx += 0x10; - basek = (8*64)+(16*16); - sizek = limitk - ((8*64)+(16*16)); + basek = 768; + sizek = limitk - basek; } //printk(BIOS_DEBUG, "node %d : mmio_basek=%08lx, basek=%08llx, limitk=%08llx\n", i, mmio_basek, basek, limitk); |