tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26837 )
Change subject: icE1usb fw: Use 'int' as the default type for port index ......................................................................
icE1usb fw: Use 'int' as the default type for port index
No benefit to use uint8_t and for consistency with later patches, use 'int' here too.
Signed-off-by: Sylvain Munaut tnt@246tNt.com Change-Id: I50a76476af844acf20436b9d410cb917b723590d --- M firmware/ice40-riscv/icE1usb/e1.h M firmware/ice40-riscv/icE1usb/misc.c 2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/37/26837/1
diff --git a/firmware/ice40-riscv/icE1usb/e1.h b/firmware/ice40-riscv/icE1usb/e1.h index 9ceffdd..862d568 100644 --- a/firmware/ice40-riscv/icE1usb/e1.h +++ b/firmware/ice40-riscv/icE1usb/e1.h @@ -57,5 +57,5 @@ E1P_LED_ST_BLINK_FAST = 3 };
-extern void e1_platform_led_set(uint8_t port, enum e1_platform_led led, +extern void e1_platform_led_set(int port, enum e1_platform_led led, enum e1_platform_led_state state); diff --git a/firmware/ice40-riscv/icE1usb/misc.c b/firmware/ice40-riscv/icE1usb/misc.c index 3117be9..a25bcc5 100644 --- a/firmware/ice40-riscv/icE1usb/misc.c +++ b/firmware/ice40-riscv/icE1usb/misc.c @@ -53,7 +53,7 @@ }
void -e1_platform_led_set(uint8_t port, enum e1_platform_led led, +e1_platform_led_set(int port, enum e1_platform_led led, enum e1_platform_led_state state) { uint32_t tmp;
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26837 )
Change subject: icE1usb fw: Use 'int' as the default type for port index ......................................................................
Patch Set 1: Code-Review+1
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26837 )
Change subject: icE1usb fw: Use 'int' as the default type for port index ......................................................................
Patch Set 1:
I would argue it should always be an unsigned integer everywhere unless there can ever be a negative port number (which I gues there cannot).
tnt has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26837 )
Change subject: icE1usb fw: Use 'int' as the default type for port index ......................................................................
Patch Set 1:
Patch Set 1:
I would argue it should always be an unsigned integer everywhere unless there can ever be a negative port number (which I gues there cannot).
Actually in the helper converting usb request to the corresponding port number, -1 is used as return code in case the request is for a non existent port. ( Because for those conversion a USB error needs to be returned rather than a panic() )
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26837 )
Change subject: icE1usb fw: Use 'int' as the default type for port index ......................................................................
Patch Set 1: Code-Review+2
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26837 )
Change subject: icE1usb fw: Use 'int' as the default type for port index ......................................................................
icE1usb fw: Use 'int' as the default type for port index
No benefit to use uint8_t and for consistency with later patches, use 'int' here too.
Signed-off-by: Sylvain Munaut tnt@246tNt.com Change-Id: I50a76476af844acf20436b9d410cb917b723590d --- M firmware/ice40-riscv/icE1usb/e1.h M firmware/ice40-riscv/icE1usb/misc.c 2 files changed, 2 insertions(+), 2 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved
diff --git a/firmware/ice40-riscv/icE1usb/e1.h b/firmware/ice40-riscv/icE1usb/e1.h index 9ceffdd..862d568 100644 --- a/firmware/ice40-riscv/icE1usb/e1.h +++ b/firmware/ice40-riscv/icE1usb/e1.h @@ -57,5 +57,5 @@ E1P_LED_ST_BLINK_FAST = 3 };
-extern void e1_platform_led_set(uint8_t port, enum e1_platform_led led, +extern void e1_platform_led_set(int port, enum e1_platform_led led, enum e1_platform_led_state state); diff --git a/firmware/ice40-riscv/icE1usb/misc.c b/firmware/ice40-riscv/icE1usb/misc.c index 3117be9..a25bcc5 100644 --- a/firmware/ice40-riscv/icE1usb/misc.c +++ b/firmware/ice40-riscv/icE1usb/misc.c @@ -53,7 +53,7 @@ }
void -e1_platform_led_set(uint8_t port, enum e1_platform_led led, +e1_platform_led_set(int port, enum e1_platform_led led, enum e1_platform_led_state state) { uint32_t tmp;