Skip to content

Commit

Permalink
tests: astlpc: Re-order astlpc ops struct definitions
Browse files Browse the repository at this point in the history
Make it easier to isolate test cases with `#if 0` hackery.

Signed-off-by: Andrew Jeffery <[email protected]>
Change-Id: Ibc3daef821768407b01f75996d3ab614bb6b6593
  • Loading branch information
amboar committed Nov 6, 2020
1 parent b3b55a6 commit 85c04e4
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions tests/test_astlpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ static int mctp_astlpc_mmio_kcs_write(void *data,

return 0;
}

static const struct mctp_binding_astlpc_ops astlpc_direct_mmio_ops = {
.kcs_read = mctp_astlpc_mmio_kcs_read,
.kcs_write = mctp_astlpc_mmio_kcs_write,
};

int mctp_astlpc_mmio_lpc_read(void *data, void *buf, long offset, size_t len)
{
struct mctp_binding_astlpc_mmio *mmio = binding_to_mmio(data);
Expand Down Expand Up @@ -134,6 +140,13 @@ int mctp_astlpc_mmio_lpc_write(void *data, const void *buf, long offset,
return 0;
}

static const struct mctp_binding_astlpc_ops astlpc_indirect_mmio_ops = {
.kcs_read = mctp_astlpc_mmio_kcs_read,
.kcs_write = mctp_astlpc_mmio_kcs_write,
.lpc_read = mctp_astlpc_mmio_lpc_read,
.lpc_write = mctp_astlpc_mmio_lpc_write,
};

#define __unused __attribute__((unused))

static void rx_message(uint8_t eid __unused, void *data __unused, void *msg,
Expand All @@ -152,18 +165,6 @@ static void rx_message(uint8_t eid __unused, void *data __unused, void *msg,
test->count++;
}

static const struct mctp_binding_astlpc_ops astlpc_direct_mmio_ops = {
.kcs_read = mctp_astlpc_mmio_kcs_read,
.kcs_write = mctp_astlpc_mmio_kcs_write,
};

static const struct mctp_binding_astlpc_ops astlpc_indirect_mmio_ops = {
.kcs_read = mctp_astlpc_mmio_kcs_read,
.kcs_write = mctp_astlpc_mmio_kcs_write,
.lpc_read = mctp_astlpc_mmio_lpc_read,
.lpc_write = mctp_astlpc_mmio_lpc_write,
};

static int endpoint_init(struct astlpc_endpoint *ep, mctp_eid_t eid,
uint8_t mode, uint32_t mtu, uint8_t (*kcs)[2],
void *lpc_mem)
Expand Down

0 comments on commit 85c04e4

Please sign in to comment.