fix warnings

This commit is contained in:
sakumisu
2022-06-15 22:09:09 +08:00
parent 131ac53ce9
commit e922b589f8
4 changed files with 10 additions and 7 deletions

View File

@@ -77,7 +77,6 @@ static void usbh_hid_devno_free(struct usbh_hid *hid_class)
static int usbh_hid_get_report_descriptor(struct usbh_hid *hid_class, uint8_t *buffer)
{
struct usb_setup_packet *setup = hid_class->hport->setup;
int ret;
setup->bmRequestType = USB_REQUEST_DIR_IN | USB_REQUEST_STANDARD | USB_REQUEST_RECIPIENT_INTERFACE;
setup->bRequest = USB_REQUEST_GET_DESCRIPTOR;

View File

@@ -78,7 +78,6 @@ static void usbh_msc_devno_free(struct usbh_msc *msc_class)
static int usbh_msc_get_maxlun(struct usbh_msc *msc_class, uint8_t *buffer)
{
struct usb_setup_packet *setup = msc_class->hport->setup;
int ret;
setup->bmRequestType = USB_REQUEST_DIR_IN | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
setup->bRequest = MSC_REQUEST_GET_MAX_LUN;

View File

@@ -841,7 +841,9 @@ int usbh_initialize(void)
int lsusb(int argc, char **argv)
{
#ifdef CONFIG_USBHOST_HUB
usb_slist_t *hub_list;
#endif
uint8_t port;
if (argc < 2) {
@@ -927,7 +929,9 @@ int lsusb(int argc, char **argv)
struct usbh_hubport *usbh_find_hubport(uint8_t dev_addr)
{
#ifdef CONFIG_USBHOST_HUB
usb_slist_t *hub_list;
#endif
uint8_t port;
for (port = USBH_HUB_PORT_START_INDEX; port <= CONFIG_USBHOST_RHPORTS; port++) {
@@ -956,7 +960,9 @@ struct usbh_hubport *usbh_find_hubport(uint8_t dev_addr)
void *usbh_find_class_instance(const char *devname)
{
#ifdef CONFIG_USBHOST_HUB
usb_slist_t *hub_list;
#endif
struct usbh_hubport *hport;
uint8_t port;

View File

@@ -554,7 +554,6 @@ int usbh_ep_alloc(usbh_epinfo_t *ep, const struct usbh_endpoint_cfg *ep_cfg)
{
struct usbh_hubport *hport;
struct musb_pipe *chan;
uint32_t chidx;
uint8_t ep_idx = 0;
uint8_t old_ep_index;
@@ -615,7 +614,7 @@ int usbh_ep_alloc(usbh_epinfo_t *ep, const struct usbh_endpoint_cfg *ep_cfg)
int usbh_ep_free(usbh_epinfo_t ep)
{
struct musb_pipe *chan = (struct musb_pipe *)ep;
//struct musb_pipe *chan = (struct musb_pipe *)ep;
return 0;
}
@@ -1156,7 +1155,7 @@ void USBH_IRQHandler(void)
if (is & USB_IS_DISCON) {
if (usbh_get_port_connect_status(0) == false) {
for (uint8_t ep_idx = 0; ep_idx < CONIFG_USB_MUSB_PIPE_NUM; ep_idx++) {
for (ep_idx = 0; ep_idx < CONIFG_USB_MUSB_PIPE_NUM; ep_idx++) {
for (uint8_t j = 0; j < 2; j++) {
chan = &g_musb_hcd.chan[ep_idx][j];
@@ -1197,7 +1196,7 @@ void USBH_IRQHandler(void)
handle_ep0();
}
for (uint32_t ep_idx = 1; ep_idx < CONIFG_USB_MUSB_PIPE_NUM; ep_idx++) {
for (ep_idx = 1; ep_idx < CONIFG_USB_MUSB_PIPE_NUM; ep_idx++) {
if (txis & (1 << ep_idx)) {
HWREGH(USB_BASE + MUSB_TXIS_OFFSET) = (1 << ep_idx);
@@ -1242,7 +1241,7 @@ void USBH_IRQHandler(void)
}
rxis &= HWREGH(USB_BASE + MUSB_RXIE_OFFSET);
for (uint32_t ep_idx = 1; ep_idx < CONIFG_USB_MUSB_PIPE_NUM; ep_idx++) {
for (ep_idx = 1; ep_idx < CONIFG_USB_MUSB_PIPE_NUM; ep_idx++) {
if (rxis & (1 << ep_idx)) {
HWREGH(USB_BASE + MUSB_RXIS_OFFSET) = (1 << ep_idx); // clear isr flag