[S] Change in osmo-e1-hardware[master]: icE1usb fw: Use NUM_E1_PORTS in e1.c
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/36683?usp=email ) Change subject: icE1usb fw: Use NUM_E1_PORTS in e1.c ...................................................................... icE1usb fw: Use NUM_E1_PORTS in e1.c Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Change-Id: Id69b4429a67ccb8834fee26b83839539a5ad8b31 --- M firmware/ice40-riscv/icE1usb/e1.c 1 file changed, 13 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/83/36683/1 diff --git a/firmware/ice40-riscv/icE1usb/e1.c b/firmware/ice40-riscv/icE1usb/e1.c index bfc042e..5e4fa33 100644 --- a/firmware/ice40-riscv/icE1usb/e1.c +++ b/firmware/ice40-riscv/icE1usb/e1.c @@ -263,13 +263,13 @@ struct e1_error_count errors; }; -static struct e1_state g_e1[2]; +static struct e1_state g_e1[NUM_E1_PORTS]; static volatile struct e1_core * _get_regs(int port) { - if ((port < 0) || (port > 1)) + if ((port < 0) || (port >= NUM_E1_PORTS)) panic("_get_regs invalid port %d", port); return &e1_regs_base[port]; } @@ -277,7 +277,7 @@ static struct e1_state * _get_state(int port) { - if ((port < 0) || (port > 1)) + if ((port < 0) || (port >= NUM_E1_PORTS)) panic("_get_state invalid port %d", port); return &g_e1[port]; } -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/36683?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1-hardware Gerrit-Branch: master Gerrit-Change-Id: Id69b4429a67ccb8834fee26b83839539a5ad8b31 Gerrit-Change-Number: 36683 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt@246tNt.com> Gerrit-MessageType: newchange
participants (1)
-
tnt