Drivers:staging:octeon-usb: Fixed Few coding style errors
PATCH 1/1 Drivers:staging:octeon-usb: Fixed Few coding style errors
fixed below errors - only few listed
octeon-hcd.c:162: ERROR: spaces prohibited around that ':' (ctx:WxW) cteon-hcd.c:249: ERROR: Macros with complex values should be enclosed in parenthesis octeon-hcd.c:992: WARNING: braces {} are not necessary for single statement blocks octeon-hcd.c:3228: ERROR: return is not a function, parentheses are not required
Signed-off-by Surendra Patil <[email protected]>
--- drivers/staging/octeon-usb/octeon-hcd.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-)
drivers/staging/octeon-usb/octeon-hcd.c +15 -16
@@ -159,13 +159,13 @@ enum cvmx_usb_complete {* status call. */ struct cvmx_usb_port_status { -uint32_t reserved :25 ; -uint32_t port_enabled :1 ; -uint32_t port_over_current :1 ; -uint32_t port_powered :1 ; -enum cvmx_usb_speed port_speed :2 ; -uint32_t connected :1 ; -uint32_t connect_change :1 ; +uint32_t reserved:25 ; +uint32_t port_enabled:1 ; +uint32_t port_over_current:1 ; +uint32_t port_powered:1 ; +enum cvmx_usb_speed port_speed:2 ; +uint32_t connected:1 ; +uint32_t connect_change:1 ; };/**
@@ -181,11 +181,11 @@ struct cvmx_usb_port_status {union cvmx_usb_control_header {uint64_t u64;struct { -uint64_t request_type :8 ; -uint64_t request :8 ; -uint64_t value :16 ; -uint64_t index :16 ; -uint64_t length :16 ; +uint64_t request_type:8 ; +uint64_t request:8 ; +uint64_t value:16 ; +uint64_t index:16 ; +uint64_t length:16 ; } s; };
@@ -246,7 +246,7 @@ enum cvmx_usb_pipe_flags { };/* Normal prefetch that use the pref instruction. */ -#define CVMX_PREFETCH (address, offset) asm volatile ("pref %[type], %[off](%[rbase])" : : [rbase] "d" (address), [off] "I" (offset), [type] "n" (0)) +#define CVMX_PREFETCH (address, offset) (asm volatile ("pref %[type], %[off](%[rbase])" : : [rbase] "d" (address), [off] "I" (offset), [type] "n" (0)))/* Maximum number of times to retry failed transactions */ #define MAX_RETRIES 3
@@ -989,9 +989,8 @@ static int cvmx_usb_enable(struct cvmx_usb_state *usb)return 0 ;/* If there is nothing plugged into the port then fail immediately */ -if (!usb->usbcx_hprt.s.prtconnsts) { +if (!usb->usbcx_hprt.s.prtconnsts)return -ETIMEDOUT ; - }/* Program the port reset bit to start the reset process */ USB_SET_FIELD32(CVMX_USBCX_HPRT(usb->index), union cvmx_usbcx_hprt, prtrst, 1);
@@ -3225,7 +3224,7 @@ static int octeon_usb_hub_status_data(struct usb_hcd *hcd, char *buf) buf[0 ] =0 ; buf[0 ] = port_status.connect_change <<1 ; -return (buf[0 ] !=0 ); +return buf[0 ] !=0 ; }static int octeon_usb_hub_control (struct usb_hcd *hcd,u16 typeReq,u16 wValue,u16 wIndex,char *buf,u16 wLength)
Signature · 1 line
1.8.3.2
Hi,
Quoted 4 lines · Surendra Patil
drivers/staging/octeon-usb/octeon-hcd.c +0
-4- uint32_t reserved : 25; - uint32_t port_enabled : 1; - uint32_t port_over_current : 1; - uint32_t port_powered : 1;
drivers/staging/octeon-usb/octeon-hcd.c enum cvmx_usb_complete { · line 168
Quoted 10 lines
drivers/staging/octeon-usb/octeon-hcd.c +7
-3- enum cvmx_usb_speed port_speed : 2; - uint32_t connected : 1; - uint32_t connect_change : 1; + uint32_t reserved:25; + uint32_t port_enabled:1; + uint32_t port_over_current:1; + uint32_t port_powered:1; + enum cvmx_usb_speed port_speed:2; + uint32_t connected:1; + uint32_t connect_change:1;
Not an improvement, please don't do this.
A.