summaryrefslogtreecommitdiff
path: root/src/usbh_core.c
diff options
context:
space:
mode:
authorAmir Hammad <amir.hammad@hotmail.com>2016-09-11 12:03:20 +0200
committerAmir Hammad <amir.hammad@hotmail.com>2016-09-11 13:31:48 +0200
commit4415d960c3d1e52573db02be4aee6e22d22809cf (patch)
tree5fb726233f1067a6c4866f00a651405921ee029f /src/usbh_core.c
parentbacf8ecdbb65774f04fce6ec6cd373a2651ddd67 (diff)
downloadsecure-hid-4415d960c3d1e52573db02be4aee6e22d22809cf.tar.gz
secure-hid-4415d960c3d1e52573db02be4aee6e22d22809cf.tar.bz2
secure-hid-4415d960c3d1e52573db02be4aee6e22d22809cf.zip
use default case instead of handling other packet statuses explicitely
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
Diffstat (limited to 'src/usbh_core.c')
-rw-r--r--src/usbh_core.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/src/usbh_core.c b/src/usbh_core.c
index 88fd665..1a60285 100644
--- a/src/usbh_core.c
+++ b/src/usbh_core.c
@@ -408,9 +408,7 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_
CONTINUE_WITH(USBH_ENUM_STATE_DEVICE_DT_READ_SETUP);
break;
- case USBH_PACKET_CALLBACK_STATUS_EFATAL:
- case USBH_PACKET_CALLBACK_STATUS_EAGAIN:
- case USBH_PACKET_CALLBACK_STATUS_ERRSIZ:
+ default:
device_enumeration_terminate(dev);
ERROR(cb_data.status);
break;
@@ -458,8 +456,7 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_
}
break;
- case USBH_PACKET_CALLBACK_STATUS_EFATAL:
- case USBH_PACKET_CALLBACK_STATUS_EAGAIN:
+ default:
device_enumeration_terminate(dev);
ERROR(cb_data.status);
break;
@@ -492,9 +489,7 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_
dev->packet_size_max0, device_enumerate, dev);
break;
- case USBH_PACKET_CALLBACK_STATUS_EFATAL:
- case USBH_PACKET_CALLBACK_STATUS_EAGAIN:
- case USBH_PACKET_CALLBACK_STATUS_ERRSIZ:
+ default:
device_enumeration_terminate(dev);
ERROR(cb_data.status);
break;
@@ -520,8 +515,7 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_
}
break;
- case USBH_PACKET_CALLBACK_STATUS_EAGAIN:
- case USBH_PACKET_CALLBACK_STATUS_EFATAL:
+ default:
device_enumeration_terminate(dev);
ERROR(cb_data.status);
break;
@@ -560,9 +554,7 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_
}
break;
- case USBH_PACKET_CALLBACK_STATUS_EFATAL:
- case USBH_PACKET_CALLBACK_STATUS_EAGAIN:
- case USBH_PACKET_CALLBACK_STATUS_ERRSIZ:
+ default:
device_enumeration_terminate(dev);
ERROR(cb_data.status);
break;
@@ -583,9 +575,7 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_
}
break;
- case USBH_PACKET_CALLBACK_STATUS_EFATAL:
- case USBH_PACKET_CALLBACK_STATUS_EAGAIN:
- case USBH_PACKET_CALLBACK_STATUS_ERRSIZ:
+ default:
device_enumeration_terminate(dev);
ERROR(cb_data.status);
break;
@@ -619,9 +609,7 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_
CONTINUE_WITH(USBH_ENUM_STATE_FIND_DRIVER);
break;
- case USBH_PACKET_CALLBACK_STATUS_EFATAL:
- case USBH_PACKET_CALLBACK_STATUS_EAGAIN:
- case USBH_PACKET_CALLBACK_STATUS_ERRSIZ:
+ default:
device_enumeration_terminate(dev);
ERROR(cb_data.status);
break;