laforge has submitted this change. ( 
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 <[email protected]>
Change-Id: Id69b4429a67ccb8834fee26b83839539a5ad8b31
---
M firmware/ice40-riscv/icE1usb/e1.c
1 file changed, 13 insertions(+), 3 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified




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: 3
Gerrit-Owner: tnt <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-MessageType: merged

Reply via email to