Change in osmo-e1-hardware[master]: icE1usb fw: Use 'int' as the default type for port index
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; -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26837 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: I50a76476af844acf20436b9d410cb917b723590d Gerrit-Change-Number: 26837 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt@246tNt.com> Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-MessageType: newchange
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 -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26837 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: I50a76476af844acf20436b9d410cb917b723590d Gerrit-Change-Number: 26837 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt@246tNt.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-Comment-Date: Mon, 10 Jan 2022 13:54:26 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
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). -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26837 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: I50a76476af844acf20436b9d410cb917b723590d Gerrit-Change-Number: 26837 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt@246tNt.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-Comment-Date: Mon, 10 Jan 2022 13:54:55 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: No Gerrit-MessageType: comment
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() ) -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26837 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: I50a76476af844acf20436b9d410cb917b723590d Gerrit-Change-Number: 26837 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt@246tNt.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-Comment-Date: Mon, 10 Jan 2022 14:16:13 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: No Gerrit-MessageType: comment
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 -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26837 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: I50a76476af844acf20436b9d410cb917b723590d Gerrit-Change-Number: 26837 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt@246tNt.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-Comment-Date: Wed, 12 Jan 2022 15:40:39 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
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; -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26837 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: I50a76476af844acf20436b9d410cb917b723590d Gerrit-Change-Number: 26837 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt@246tNt.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-MessageType: merged
participants (2)
-
laforge -
tnt