* [PATCH] Drivers:staging:octeon-usb: Fixed Few coding style errors
@ 2014-01-31 6:35 Surendra Patil
2014-01-31 19:53 ` Aaro Koskinen
0 siblings, 1 reply; 2+ messages in thread
From: Surendra Patil @ 2014-01-31 6:35 UTC (permalink / raw)
To: gregkh, aaro.koskinen, devendra.aaru; +Cc: surendra.tux, devel, linux-kernel
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 <surendra.tux@gmail.com>
---
drivers/staging/octeon-usb/octeon-hcd.c | 31 +++++++++++++++----------------
1 file changed, 15 insertions(+), 16 deletions(-)
diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c
index 47e0a91..b25e0f8 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.c
+++ b/drivers/staging/octeon-usb/octeon-hcd.c
@@ -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)
--
1.8.3.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Drivers:staging:octeon-usb: Fixed Few coding style errors
2014-01-31 6:35 [PATCH] Drivers:staging:octeon-usb: Fixed Few coding style errors Surendra Patil
@ 2014-01-31 19:53 ` Aaro Koskinen
0 siblings, 0 replies; 2+ messages in thread
From: Aaro Koskinen @ 2014-01-31 19:53 UTC (permalink / raw)
To: Surendra Patil; +Cc: gregkh, devendra.aaru, devel, linux-kernel
Hi,
On Thu, Jan 30, 2014 at 10:35:19PM -0800, Surendra Patil wrote:
> - 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;
Not an improvement, please don't do this.
A.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-01-31 19:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-31 6:35 [PATCH] Drivers:staging:octeon-usb: Fixed Few coding style errors Surendra Patil
2014-01-31 19:53 ` Aaro Koskinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).