Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rk3588Mem.c - inconsistent Base System RAM length #104

Merged
merged 1 commit into from
Nov 23, 2023

Conversation

idigdoug
Copy link
Contributor

The Base System RAM section nominally starts at mSystemMemoryBase but computes its length as if it starts at 0. This happens to be fine since mSystemMemoryBase actually is 0, so this doesn't cause any real problems, but it seems inconsistent to use a symbol in one place and an implicitly-hard-coded 0 elsewhere.

Fix is to use subtract the value of mSystemMemoryBase from the length. Since mSystemMemoryBase is 0, this is a no-op, but it makes the table use consistent logic, and might avoid a future issue if this code is ever copy-pasted somewhere that base is not 0.

The Base System RAM  section nominally starts at `mSystemMemoryBase` but
computes its length as if it starts at `0`. This happens to be fine
since `mSystemMemoryBase` actually is `0`, so this doesn't cause any
real problems, but it seems inconsistent to use a symbol in one place
and an implicitly-hard-coded `0` elsewhere.

Fix is to use subtract the value of `mSystemMemoryBase` from the length.
Since `mSystemMemoryBase` is `0`, this is a no-op, but it makes the
table use consistent logic, and might avoid a future issue if this code
is ever copy-pasted somewhere that base is not 0.
@mariobalanica mariobalanica merged commit 9529bc4 into edk2-porting:master Nov 23, 2023
15 checks passed
@idigdoug idigdoug deleted the baseSystemRamLength branch November 23, 2023 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants