Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/46813 )
Change subject: internal.c: Reshuffle functions to avoid forward decls ......................................................................
internal.c: Reshuffle functions to avoid forward decls
This just makes internal.c a little easier to parse and avoids some fn prototypes on the metal stack.
BUG=none BRANCH=none TEST=builds
Change-Id: I693e30068e6a53b5fc161d895af451540650a8fe Signed-off-by: Edward O'Callaghan quasisec@google.com --- M internal.c 1 file changed, 36 insertions(+), 50 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/13/46813/1
diff --git a/internal.c b/internal.c index 44570a5..abd90a8 100644 --- a/internal.c +++ b/internal.c @@ -114,19 +114,48 @@ int laptop_ok = 0;
static void internal_chip_writeb(const struct flashctx *flash, uint8_t val, - chipaddr addr); + chipaddr addr) +{ + mmio_writeb(val, (void *) addr); +} + static void internal_chip_writew(const struct flashctx *flash, uint16_t val, - chipaddr addr); + chipaddr addr) +{ + mmio_writew(val, (void *) addr); +} + static void internal_chip_writel(const struct flashctx *flash, uint32_t val, - chipaddr addr); + chipaddr addr) +{ + mmio_writel(val, (void *) addr); +} + static uint8_t internal_chip_readb(const struct flashctx *flash, - const chipaddr addr); + const chipaddr addr) +{ + return mmio_readb((void *) addr); +} + static uint16_t internal_chip_readw(const struct flashctx *flash, - const chipaddr addr); + const chipaddr addr) +{ + return mmio_readw((void *) addr); +} + static uint32_t internal_chip_readl(const struct flashctx *flash, - const chipaddr addr); + const chipaddr addr) +{ + return mmio_readl((void *) addr); +} + static void internal_chip_readn(const struct flashctx *flash, uint8_t *buf, - const chipaddr addr, size_t len); + const chipaddr addr, size_t len) +{ + mmio_readn((void *)addr, buf, len); + return; +} + static const struct par_master par_master_internal = { .chip_readb = internal_chip_readb, .chip_readw = internal_chip_readw, @@ -344,46 +373,3 @@
return ret; } - -static void internal_chip_writeb(const struct flashctx *flash, uint8_t val, - chipaddr addr) -{ - mmio_writeb(val, (void *) addr); -} - -static void internal_chip_writew(const struct flashctx *flash, uint16_t val, - chipaddr addr) -{ - mmio_writew(val, (void *) addr); -} - -static void internal_chip_writel(const struct flashctx *flash, uint32_t val, - chipaddr addr) -{ - mmio_writel(val, (void *) addr); -} - -static uint8_t internal_chip_readb(const struct flashctx *flash, - const chipaddr addr) -{ - return mmio_readb((void *) addr); -} - -static uint16_t internal_chip_readw(const struct flashctx *flash, - const chipaddr addr) -{ - return mmio_readw((void *) addr); -} - -static uint32_t internal_chip_readl(const struct flashctx *flash, - const chipaddr addr) -{ - return mmio_readl((void *) addr); -} - -static void internal_chip_readn(const struct flashctx *flash, uint8_t *buf, - const chipaddr addr, size_t len) -{ - mmio_readn((void *)addr, buf, len); - return; -}
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/46813 )
Change subject: internal.c: Reshuffle functions to avoid forward decls ......................................................................
Patch Set 1: Code-Review+1
(1 comment)
https://review.coreboot.org/c/flashrom/+/46813/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/flashrom/+/46813/1//COMMIT_MSG@10 PS1, Line 10: metal stack What's a metal stack?
Hello build bot (Jenkins), Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/46813
to look at the new patch set (#2).
Change subject: internal.c: Reshuffle functions to avoid forward decls ......................................................................
internal.c: Reshuffle functions to avoid forward decls
This just makes internal.c a little easier to parse and avoids some fn prototypes on the mental stack.
BUG=none BRANCH=none TEST=builds
Change-Id: I693e30068e6a53b5fc161d895af451540650a8fe Signed-off-by: Edward O'Callaghan quasisec@google.com --- M internal.c 1 file changed, 36 insertions(+), 50 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/13/46813/2
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/46813 )
Change subject: internal.c: Reshuffle functions to avoid forward decls ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/flashrom/+/46813/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/flashrom/+/46813/1//COMMIT_MSG@10 PS1, Line 10: metal stack
What's a metal stack?
Programming while listening to rock. Done
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/46813 )
Change subject: internal.c: Reshuffle functions to avoid forward decls ......................................................................
Patch Set 2: Code-Review+2
(1 comment)
https://review.coreboot.org/c/flashrom/+/46813/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/flashrom/+/46813/1//COMMIT_MSG@10 PS1, Line 10: metal stack
Programming while listening to rock. […]
😄
Edward O'Callaghan has submitted this change. ( https://review.coreboot.org/c/flashrom/+/46813 )
Change subject: internal.c: Reshuffle functions to avoid forward decls ......................................................................
internal.c: Reshuffle functions to avoid forward decls
This just makes internal.c a little easier to parse and avoids some fn prototypes on the mental stack.
BUG=none BRANCH=none TEST=builds
Change-Id: I693e30068e6a53b5fc161d895af451540650a8fe Signed-off-by: Edward O'Callaghan quasisec@google.com Reviewed-on: https://review.coreboot.org/c/flashrom/+/46813 Reviewed-by: Angel Pons th3fanbus@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M internal.c 1 file changed, 36 insertions(+), 50 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved
diff --git a/internal.c b/internal.c index 44570a5..abd90a8 100644 --- a/internal.c +++ b/internal.c @@ -114,19 +114,48 @@ int laptop_ok = 0;
static void internal_chip_writeb(const struct flashctx *flash, uint8_t val, - chipaddr addr); + chipaddr addr) +{ + mmio_writeb(val, (void *) addr); +} + static void internal_chip_writew(const struct flashctx *flash, uint16_t val, - chipaddr addr); + chipaddr addr) +{ + mmio_writew(val, (void *) addr); +} + static void internal_chip_writel(const struct flashctx *flash, uint32_t val, - chipaddr addr); + chipaddr addr) +{ + mmio_writel(val, (void *) addr); +} + static uint8_t internal_chip_readb(const struct flashctx *flash, - const chipaddr addr); + const chipaddr addr) +{ + return mmio_readb((void *) addr); +} + static uint16_t internal_chip_readw(const struct flashctx *flash, - const chipaddr addr); + const chipaddr addr) +{ + return mmio_readw((void *) addr); +} + static uint32_t internal_chip_readl(const struct flashctx *flash, - const chipaddr addr); + const chipaddr addr) +{ + return mmio_readl((void *) addr); +} + static void internal_chip_readn(const struct flashctx *flash, uint8_t *buf, - const chipaddr addr, size_t len); + const chipaddr addr, size_t len) +{ + mmio_readn((void *)addr, buf, len); + return; +} + static const struct par_master par_master_internal = { .chip_readb = internal_chip_readb, .chip_readw = internal_chip_readw, @@ -344,46 +373,3 @@
return ret; } - -static void internal_chip_writeb(const struct flashctx *flash, uint8_t val, - chipaddr addr) -{ - mmio_writeb(val, (void *) addr); -} - -static void internal_chip_writew(const struct flashctx *flash, uint16_t val, - chipaddr addr) -{ - mmio_writew(val, (void *) addr); -} - -static void internal_chip_writel(const struct flashctx *flash, uint32_t val, - chipaddr addr) -{ - mmio_writel(val, (void *) addr); -} - -static uint8_t internal_chip_readb(const struct flashctx *flash, - const chipaddr addr) -{ - return mmio_readb((void *) addr); -} - -static uint16_t internal_chip_readw(const struct flashctx *flash, - const chipaddr addr) -{ - return mmio_readw((void *) addr); -} - -static uint32_t internal_chip_readl(const struct flashctx *flash, - const chipaddr addr) -{ - return mmio_readl((void *) addr); -} - -static void internal_chip_readn(const struct flashctx *flash, uint8_t *buf, - const chipaddr addr, size_t len) -{ - mmio_readn((void *)addr, buf, len); - return; -}