You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ar...@apache.org on 2024/03/21 12:06:19 UTC

(nuttx) branch master updated: cdcecm: remove duplicate assignment statements

This is an automated email from the ASF dual-hosted git repository.

archer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new a65cdce281 cdcecm: remove duplicate assignment statements
a65cdce281 is described below

commit a65cdce281c02dc00aa611e5fea52042d304ea34
Author: zhanghongyu <zh...@xiaomi.com>
AuthorDate: Wed Mar 20 14:45:59 2024 +0800

    cdcecm: remove duplicate assignment statements
    
    Signed-off-by: zhanghongyu <zh...@xiaomi.com>
---
 drivers/usbdev/cdcecm.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/usbdev/cdcecm.c b/drivers/usbdev/cdcecm.c
index d865d803d9..50ba1b0443 100644
--- a/drivers/usbdev/cdcecm.c
+++ b/drivers/usbdev/cdcecm.c
@@ -950,6 +950,7 @@ static void cdcecm_resetconfig(FAR struct cdcecm_driver_s *self)
 static int cdcecm_setconfig(FAR struct cdcecm_driver_s *self, uint8_t config)
 {
   struct usb_epdesc_s epdesc;
+  bool is_high_speed;
   int ret = OK;
 
   if (config == self->config)
@@ -979,7 +980,7 @@ static int cdcecm_setconfig(FAR struct cdcecm_driver_s *self, uint8_t config)
 
   self->epint->priv = self;
 
-  bool is_high_speed = (self->usbdev.speed == USB_SPEED_HIGH);
+  is_high_speed = (self->usbdev.speed == USB_SPEED_HIGH);
   cdcecm_mkepdesc(CDCECM_EP_BULKIN_IDX,
                   &epdesc, &self->devinfo, is_high_speed);
   ret = EP_CONFIGURE(self->epbulkin, &epdesc, false);
@@ -1365,7 +1366,7 @@ static int16_t cdcecm_mkcfgdesc(FAR uint8_t *desc,
 
   if (desc)
     {
-      FAR struct usb_ifdesc_s *ifdesc = (FAR struct usb_ifdesc_s *)desc;
+      FAR struct usb_ifdesc_s *ifdesc;
 
       ifdesc = (FAR struct usb_ifdesc_s *)desc;
       ifdesc->len      = USB_SIZEOF_IFDESC;
@@ -1385,7 +1386,7 @@ static int16_t cdcecm_mkcfgdesc(FAR uint8_t *desc,
 
   if (desc)
     {
-      FAR struct usb_ifdesc_s *ifdesc = (FAR struct usb_ifdesc_s *)desc;
+      FAR struct usb_ifdesc_s *ifdesc;
 
       ifdesc = (FAR struct usb_ifdesc_s *)desc;
       ifdesc->len      = USB_SIZEOF_IFDESC;