Skip to content

Commit 1dbf021

Browse files
committed
test_astlpc: Do debug logging before asserts
This way if the asserts fire it's obvious why. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ibc3d9231696ec524498615a9d75c6ba19c060a7f
1 parent f5afcd7 commit 1dbf021

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/test_astlpc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,27 +98,27 @@ int mctp_astlpc_mmio_lpc_read(void *data, void *buf, long offset, size_t len)
9898
{
9999
struct mctp_binding_astlpc_mmio *mmio = binding_to_mmio(data);
100100

101+
mctp_prdebug("%s: %zu bytes from 0x%lx", __func__, len, offset);
102+
101103
assert(offset >= 0L);
102104
assert(offset + len < mmio->lpc_size);
103105

104106
memcpy(buf, mmio->lpc + offset, len);
105107

106-
mctp_prdebug("%s: %zu bytes from 0x%lx", __func__, len, offset);
107-
108108
return 0;
109109
}
110110

111111
int mctp_astlpc_mmio_lpc_write(void *data, void *buf, long offset, size_t len)
112112
{
113113
struct mctp_binding_astlpc_mmio *mmio = binding_to_mmio(data);
114114

115+
mctp_prdebug("%s: %zu bytes to 0x%lx", __func__, len, offset);
116+
115117
assert(offset >= 0L);
116118
assert(offset + len < mmio->lpc_size);
117119

118120
memcpy(mmio->lpc + offset, buf, len);
119121

120-
mctp_prdebug("%s: %zu bytes to 0x%lx", __func__, len, offset);
121-
122122
return 0;
123123
}
124124

0 commit comments

Comments
 (0)