Fix usbdev/usbmsc_desc.c:316:7: error: variable 'length' set but not used [-Werror,-Wunused-but-set-variable]

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-10-26 11:08:43 +08:00 committed by Petro Karashchenko
parent d8babf8dfd
commit 929882862b

View File

@ -313,7 +313,6 @@ int16_t usbmsc_mkcfgdesc(uint8_t *buf,
FAR struct usbdev_devinfo_s *devinfo) FAR struct usbdev_devinfo_s *devinfo)
#endif #endif
{ {
int length = 0;
bool hispeed = false; bool hispeed = false;
#ifdef CONFIG_USBDEV_DUALSPEED #ifdef CONFIG_USBDEV_DUALSPEED
@ -360,7 +359,6 @@ int16_t usbmsc_mkcfgdesc(uint8_t *buf,
dest->mxpower = (CONFIG_USBDEV_MAXPOWER + 1) / 2; /* Max power (mA/2) */ dest->mxpower = (CONFIG_USBDEV_MAXPOWER + 1) / 2; /* Max power (mA/2) */
buf += sizeof(struct usb_cfgdesc_s); buf += sizeof(struct usb_cfgdesc_s);
length += sizeof(struct usb_cfgdesc_s);
} }
#endif #endif
@ -382,7 +380,6 @@ int16_t usbmsc_mkcfgdesc(uint8_t *buf,
dest->iif = devinfo->strbase + USBMSC_INTERFACESTRID; /* iInterface */ dest->iif = devinfo->strbase + USBMSC_INTERFACESTRID; /* iInterface */
buf += sizeof(struct usb_ifdesc_s); buf += sizeof(struct usb_ifdesc_s);
length += sizeof(struct usb_ifdesc_s);
} }
/* Make the two endpoint configurations */ /* Make the two endpoint configurations */
@ -395,7 +392,6 @@ int16_t usbmsc_mkcfgdesc(uint8_t *buf,
devinfo, hispeed); devinfo, hispeed);
buf += len; buf += len;
length += len;
} }
/* Bulk OUT endpoint descriptor */ /* Bulk OUT endpoint descriptor */
@ -406,7 +402,6 @@ int16_t usbmsc_mkcfgdesc(uint8_t *buf,
hispeed); hispeed);
buf += len; buf += len;
length += len;
} }
return SIZEOF_USBMSC_CFGDESC; return SIZEOF_USBMSC_CFGDESC;