Skip to content

Commit

Permalink
Merge pull request #40 from zevweiss/macro-use-cleanup
Browse files Browse the repository at this point in the history
bridge: Use available macros instead of numeric literals

Signed-off-by: Andrew Jeffery <[email protected]>
  • Loading branch information
amboar authored Oct 26, 2023
2 parents 54d21e7 + 6383a62 commit 882eda0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/bridge/devmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ int devmem_init(struct devmem *ctx)
if (ctx->fd < 0)
return -errno;

ctx->io = mmap(NULL, 0x00200000, PROT_READ | PROT_WRITE, MAP_SHARED,
ctx->fd, 0x1e600000);
ctx->io = mmap(NULL, AST_SOC_IO_LEN, PROT_READ | PROT_WRITE, MAP_SHARED,
ctx->fd, AST_SOC_IO);
if (ctx->io == MAP_FAILED) { rc = -errno; goto cleanup_fd; }

ctx->win = NULL;
Expand All @@ -200,7 +200,7 @@ int devmem_destroy(struct devmem *ctx)

assert(!ctx->win);

rc = munmap(ctx->io, 0x00200000);
rc = munmap(ctx->io, AST_SOC_IO_LEN);
if (rc < 0) { perror("munmap"); }

rc = close(ctx->fd);
Expand Down
4 changes: 2 additions & 2 deletions src/bridge/l2a.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ int l2ab_destroy(struct l2ab *ctx)
struct ilpcb *ilpcb = &ctx->ilpcb;
int rc;

rc = ilpcb_writel(ilpcb_as_ahb(ilpcb), 0x1e78908c, ctx->restore8);
rc = ilpcb_writel(ilpcb_as_ahb(ilpcb), LPC_HICR8, ctx->restore8);
if (rc)
return rc;

rc = ilpcb_writel(ilpcb_as_ahb(ilpcb), 0x1e789088, ctx->restore7);
rc = ilpcb_writel(ilpcb_as_ahb(ilpcb), LPC_HICR7, ctx->restore7);
if (rc)
return rc;

Expand Down

0 comments on commit 882eda0

Please sign in to comment.