All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/9] usb: host: ehci.h: remove space before comma
@ 2015-12-09 22:15 Geyslan G. Bem
  2015-12-09 22:15 ` [PATCH 2/9] usb: host: ehci.h: remove space before function open parenthesis Geyslan G. Bem
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Geyslan G. Bem @ 2015-12-09 22:15 UTC (permalink / raw)
  To: peter.senna
  Cc: Geyslan G. Bem, Alan Stern, Greg Kroah-Hartman, linux-usb, linux-kernel

Get rid of spaces before comma.

Caught by cppcheck: "ERROR: space prohibited before that ','"

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 drivers/usb/host/ehci.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index ec61aed..6a36ef4 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -852,13 +852,13 @@ static inline u32 hc32_to_cpup (const struct ehci_hcd *ehci, const __hc32 *x)
 /*-------------------------------------------------------------------------*/
 
 #define ehci_dbg(ehci, fmt, args...) \
-	dev_dbg(ehci_to_hcd(ehci)->self.controller , fmt , ## args)
+	dev_dbg(ehci_to_hcd(ehci)->self.controller, fmt, ## args)
 #define ehci_err(ehci, fmt, args...) \
-	dev_err(ehci_to_hcd(ehci)->self.controller , fmt , ## args)
+	dev_err(ehci_to_hcd(ehci)->self.controller, fmt, ## args)
 #define ehci_info(ehci, fmt, args...) \
-	dev_info(ehci_to_hcd(ehci)->self.controller , fmt , ## args)
+	dev_info(ehci_to_hcd(ehci)->self.controller, fmt, ## args)
 #define ehci_warn(ehci, fmt, args...) \
-	dev_warn(ehci_to_hcd(ehci)->self.controller , fmt , ## args)
+	dev_warn(ehci_to_hcd(ehci)->self.controller, fmt, ## args)
 
 
 #ifndef CONFIG_DYNAMIC_DEBUG
-- 
2.6.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/9] usb: host: ehci.h: remove space before function open parenthesis
  2015-12-09 22:15 [PATCH 1/9] usb: host: ehci.h: remove space before comma Geyslan G. Bem
@ 2015-12-09 22:15 ` Geyslan G. Bem
  2015-12-09 22:15 ` [PATCH 3/9] usb: host: ehci.h: remove space before open square bracket Geyslan G. Bem
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Geyslan G. Bem @ 2015-12-09 22:15 UTC (permalink / raw)
  To: peter.senna
  Cc: Geyslan G. Bem, Alan Stern, Greg Kroah-Hartman, linux-usb, linux-kernel

Get rid of space between function name and open parenthesis.

Caught by cppcheck: "WARNING: space prohibited between function name
and open parenthesis '('"

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 drivers/usb/host/ehci.h | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 6a36ef4..46982df 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -268,13 +268,13 @@ struct ehci_hcd {			/* one per controller */
 };
 
 /* convert between an HCD pointer and the corresponding EHCI_HCD */
-static inline struct ehci_hcd *hcd_to_ehci (struct usb_hcd *hcd)
+static inline struct ehci_hcd *hcd_to_ehci(struct usb_hcd *hcd)
 {
 	return (struct ehci_hcd *) (hcd->hcd_priv);
 }
-static inline struct usb_hcd *ehci_to_hcd (struct ehci_hcd *ehci)
+static inline struct usb_hcd *ehci_to_hcd(struct ehci_hcd *ehci)
 {
-	return container_of ((void *) ehci, struct usb_hcd, hcd_priv);
+	return container_of((void *) ehci, struct usb_hcd, hcd_priv);
 }
 
 /*-------------------------------------------------------------------------*/
@@ -327,9 +327,9 @@ struct ehci_qtd {
 } __attribute__ ((aligned (32)));
 
 /* mask NakCnt+T in qh->hw_alt_next */
-#define QTD_MASK(ehci)	cpu_to_hc32 (ehci, ~0x1f)
+#define QTD_MASK(ehci)	cpu_to_hc32(ehci, ~0x1f)
 
-#define IS_SHORT_READ(token) (QTD_LENGTH (token) != 0 && QTD_PID (token) == 1)
+#define IS_SHORT_READ(token) (QTD_LENGTH(token) != 0 && QTD_PID(token) == 1)
 
 /*-------------------------------------------------------------------------*/
 
@@ -806,7 +806,7 @@ static inline void set_ohci_hcfs(struct ehci_hcd *ehci, int operational)
 #define ehci_big_endian_desc(e)		((e)->big_endian_desc)
 
 /* cpu to ehci */
-static inline __hc32 cpu_to_hc32 (const struct ehci_hcd *ehci, const u32 x)
+static inline __hc32 cpu_to_hc32(const struct ehci_hcd *ehci, const u32 x)
 {
 	return ehci_big_endian_desc(ehci)
 		? (__force __hc32)cpu_to_be32(x)
@@ -814,14 +814,14 @@ static inline __hc32 cpu_to_hc32 (const struct ehci_hcd *ehci, const u32 x)
 }
 
 /* ehci to cpu */
-static inline u32 hc32_to_cpu (const struct ehci_hcd *ehci, const __hc32 x)
+static inline u32 hc32_to_cpu(const struct ehci_hcd *ehci, const __hc32 x)
 {
 	return ehci_big_endian_desc(ehci)
 		? be32_to_cpu((__force __be32)x)
 		: le32_to_cpu((__force __le32)x);
 }
 
-static inline u32 hc32_to_cpup (const struct ehci_hcd *ehci, const __hc32 *x)
+static inline u32 hc32_to_cpup(const struct ehci_hcd *ehci, const __hc32 *x)
 {
 	return ehci_big_endian_desc(ehci)
 		? be32_to_cpup((__force __be32 *)x)
@@ -831,18 +831,18 @@ static inline u32 hc32_to_cpup (const struct ehci_hcd *ehci, const __hc32 *x)
 #else
 
 /* cpu to ehci */
-static inline __hc32 cpu_to_hc32 (const struct ehci_hcd *ehci, const u32 x)
+static inline __hc32 cpu_to_hc32(const struct ehci_hcd *ehci, const u32 x)
 {
 	return cpu_to_le32(x);
 }
 
 /* ehci to cpu */
-static inline u32 hc32_to_cpu (const struct ehci_hcd *ehci, const __hc32 x)
+static inline u32 hc32_to_cpu(const struct ehci_hcd *ehci, const __hc32 x)
 {
 	return le32_to_cpu(x);
 }
 
-static inline u32 hc32_to_cpup (const struct ehci_hcd *ehci, const __hc32 *x)
+static inline u32 hc32_to_cpup(const struct ehci_hcd *ehci, const __hc32 *x)
 {
 	return le32_to_cpup(x);
 }
-- 
2.6.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/9] usb: host: ehci.h: remove space before open square bracket
  2015-12-09 22:15 [PATCH 1/9] usb: host: ehci.h: remove space before comma Geyslan G. Bem
  2015-12-09 22:15 ` [PATCH 2/9] usb: host: ehci.h: remove space before function open parenthesis Geyslan G. Bem
@ 2015-12-09 22:15 ` Geyslan G. Bem
  2015-12-09 22:15 ` [PATCH 4/9] usb: host: ehci.h: fix single statement macros Geyslan G. Bem
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Geyslan G. Bem @ 2015-12-09 22:15 UTC (permalink / raw)
  To: peter.senna
  Cc: Geyslan G. Bem, Alan Stern, Greg Kroah-Hartman, linux-usb, linux-kernel

Get rid of space before open square bracket.

Caught by cppcheck: "ERROR: space prohibited before open square
bracket '['"

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 drivers/usb/host/ehci.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 46982df..cfeebd8 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -185,7 +185,7 @@ struct ehci_hcd {			/* one per controller */
 	struct ehci_sitd	*last_sitd_to_free;
 
 	/* per root hub port */
-	unsigned long		reset_done [EHCI_MAX_ROOT_PORTS];
+	unsigned long		reset_done[EHCI_MAX_ROOT_PORTS];
 
 	/* bit vectors (one bit per port) */
 	unsigned long		bus_suspended;		/* which ports were
@@ -316,8 +316,8 @@ struct ehci_qtd {
 #define HALT_BIT(ehci)		cpu_to_hc32(ehci, QTD_STS_HALT)
 #define STATUS_BIT(ehci)	cpu_to_hc32(ehci, QTD_STS_STS)
 
-	__hc32			hw_buf [5];        /* see EHCI 3.5.4 */
-	__hc32			hw_buf_hi [5];        /* Appendix B */
+	__hc32			hw_buf[5];        /* see EHCI 3.5.4 */
+	__hc32			hw_buf_hi[5];        /* Appendix B */
 
 	/* the rest is HCD-private */
 	dma_addr_t		qtd_dma;		/* qtd address */
@@ -405,8 +405,8 @@ struct ehci_qh_hw {
 	__hc32			hw_qtd_next;
 	__hc32			hw_alt_next;
 	__hc32			hw_token;
-	__hc32			hw_buf [5];
-	__hc32			hw_buf_hi [5];
+	__hc32			hw_buf[5];
+	__hc32			hw_buf_hi[5];
 } __attribute__ ((aligned(32)));
 
 struct ehci_qh {
@@ -510,7 +510,7 @@ struct ehci_iso_stream {
 struct ehci_itd {
 	/* first part defined by EHCI spec */
 	__hc32			hw_next;           /* see EHCI 3.3.1 */
-	__hc32			hw_transaction [8]; /* see EHCI 3.3.2 */
+	__hc32			hw_transaction[8]; /* see EHCI 3.3.2 */
 #define EHCI_ISOC_ACTIVE        (1<<31)        /* activate transfer this slot */
 #define EHCI_ISOC_BUF_ERR       (1<<30)        /* Data buffer error */
 #define EHCI_ISOC_BABBLE        (1<<29)        /* babble detected */
@@ -520,8 +520,8 @@ struct ehci_itd {
 
 #define ITD_ACTIVE(ehci)	cpu_to_hc32(ehci, EHCI_ISOC_ACTIVE)
 
-	__hc32			hw_bufp [7];	/* see EHCI 3.3.3 */
-	__hc32			hw_bufp_hi [7];	/* Appendix B */
+	__hc32			hw_bufp[7];	/* see EHCI 3.3.3 */
+	__hc32			hw_bufp_hi[7];	/* Appendix B */
 
 	/* the rest is HCD-private */
 	dma_addr_t		itd_dma;	/* for this itd */
@@ -565,9 +565,9 @@ struct ehci_sitd {
 
 #define SITD_ACTIVE(ehci)	cpu_to_hc32(ehci, SITD_STS_ACTIVE)
 
-	__hc32			hw_buf [2];		/* EHCI table 3-12 */
+	__hc32			hw_buf[2];		/* EHCI table 3-12 */
 	__hc32			hw_backpointer;		/* EHCI table 3-13 */
-	__hc32			hw_buf_hi [2];		/* Appendix B */
+	__hc32			hw_buf_hi[2];		/* Appendix B */
 
 	/* the rest is HCD-private */
 	dma_addr_t		sitd_dma;
-- 
2.6.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/9] usb: host: ehci.h: fix single statement macros
  2015-12-09 22:15 [PATCH 1/9] usb: host: ehci.h: remove space before comma Geyslan G. Bem
  2015-12-09 22:15 ` [PATCH 2/9] usb: host: ehci.h: remove space before function open parenthesis Geyslan G. Bem
  2015-12-09 22:15 ` [PATCH 3/9] usb: host: ehci.h: remove space before open square bracket Geyslan G. Bem
@ 2015-12-09 22:15 ` Geyslan G. Bem
  2015-12-09 22:15 ` [PATCH 5/9] usb: host: ehci.h: remove direct use of __attribute__ keyword Geyslan G. Bem
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Geyslan G. Bem @ 2015-12-09 22:15 UTC (permalink / raw)
  To: peter.senna
  Cc: Geyslan G. Bem, Alan Stern, Greg Kroah-Hartman, linux-usb, linux-kernel

Don't use the 'do {} while (0)' wrapper in a single statement macro.

Caught by cppcheck: "WARNING: Single statement macros should not
use a do {} while (0) loop"

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 drivers/usb/host/ehci.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index cfeebd8..945000a 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -244,9 +244,9 @@ struct ehci_hcd {			/* one per controller */
 	/* irq statistics */
 #ifdef EHCI_STATS
 	struct ehci_stats	stats;
-#	define COUNT(x) do { (x)++; } while (0)
+#	define COUNT(x) ((x)++)
 #else
-#	define COUNT(x) do {} while (0)
+#	define COUNT(x) ((void) 0)
 #endif
 
 	/* debug files */
-- 
2.6.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/9] usb: host: ehci.h: remove direct use of __attribute__ keyword
  2015-12-09 22:15 [PATCH 1/9] usb: host: ehci.h: remove space before comma Geyslan G. Bem
                   ` (2 preceding siblings ...)
  2015-12-09 22:15 ` [PATCH 4/9] usb: host: ehci.h: fix single statement macros Geyslan G. Bem
@ 2015-12-09 22:15 ` Geyslan G. Bem
  2015-12-09 22:15 ` [PATCH 6/9] usb: host: ehci.h: use space after comma Geyslan G. Bem
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Geyslan G. Bem @ 2015-12-09 22:15 UTC (permalink / raw)
  To: peter.senna
  Cc: Geyslan G. Bem, Alan Stern, Greg Kroah-Hartman, linux-usb, linux-kernel

Prefer to use __aligned(size) macro instead of
__attribute__((aligned(size))).

Caught by cppcheck: "WARNING"

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 drivers/usb/host/ehci.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 945000a..7b2b213 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -324,7 +324,7 @@ struct ehci_qtd {
 	struct list_head	qtd_list;		/* sw qtd list */
 	struct urb		*urb;			/* qtd's urb */
 	size_t			length;			/* length of buffer */
-} __attribute__ ((aligned (32)));
+} __aligned(32);
 
 /* mask NakCnt+T in qh->hw_alt_next */
 #define QTD_MASK(ehci)	cpu_to_hc32(ehci, ~0x1f)
@@ -407,7 +407,7 @@ struct ehci_qh_hw {
 	__hc32			hw_token;
 	__hc32			hw_buf[5];
 	__hc32			hw_buf_hi[5];
-} __attribute__ ((aligned(32)));
+} __aligned(32);
 
 struct ehci_qh {
 	struct ehci_qh_hw	*hw;		/* Must come first */
@@ -535,7 +535,7 @@ struct ehci_itd {
 	unsigned		frame;		/* where scheduled */
 	unsigned		pg;
 	unsigned		index[8];	/* in urb->iso_frame_desc */
-} __attribute__ ((aligned (32)));
+} __aligned(32);
 
 /*-------------------------------------------------------------------------*/
 
@@ -578,7 +578,7 @@ struct ehci_sitd {
 	struct list_head	sitd_list;	/* list of stream's sitds */
 	unsigned		frame;
 	unsigned		index;
-} __attribute__ ((aligned (32)));
+} __aligned(32);
 
 /*-------------------------------------------------------------------------*/
 
@@ -598,7 +598,7 @@ struct ehci_fstn {
 	/* the rest is HCD-private */
 	dma_addr_t		fstn_dma;
 	union ehci_shadow	fstn_next;	/* ptr to periodic q entry */
-} __attribute__ ((aligned (32)));
+} __aligned(32);
 
 /*-------------------------------------------------------------------------*/
 
-- 
2.6.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 6/9] usb: host: ehci.h: use space after comma
  2015-12-09 22:15 [PATCH 1/9] usb: host: ehci.h: remove space before comma Geyslan G. Bem
                   ` (3 preceding siblings ...)
  2015-12-09 22:15 ` [PATCH 5/9] usb: host: ehci.h: remove direct use of __attribute__ keyword Geyslan G. Bem
@ 2015-12-09 22:15 ` Geyslan G. Bem
  2015-12-09 22:15 ` [PATCH 7/9] usb: host: ehci.h: remove macros trailing semicolon Geyslan G. Bem
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Geyslan G. Bem @ 2015-12-09 22:15 UTC (permalink / raw)
  To: peter.senna
  Cc: Geyslan G. Bem, Alan Stern, Greg Kroah-Hartman, linux-usb, linux-kernel

Put space after comma.

This patch also changes QH_NEXT macro for better reading.

Caught by cppcheck: "ERROR: space required after that ','"

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 drivers/usb/host/ehci.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 7b2b213..ea56147 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -334,7 +334,7 @@ struct ehci_qtd {
 /*-------------------------------------------------------------------------*/
 
 /* type tag from {qh,itd,sitd,fstn}->hw_next */
-#define Q_NEXT_TYPE(ehci,dma)	((dma) & cpu_to_hc32(ehci, 3 << 1))
+#define Q_NEXT_TYPE(ehci, dma)	((dma) & cpu_to_hc32(ehci, 3 << 1))
 
 /*
  * Now the following defines are not converted using the
@@ -350,7 +350,8 @@ struct ehci_qtd {
 #define Q_TYPE_FSTN	(3 << 1)
 
 /* next async queue entry, or pointer to interrupt/periodic QH */
-#define QH_NEXT(ehci,dma)	(cpu_to_hc32(ehci, (((u32)dma)&~0x01f)|Q_TYPE_QH))
+#define QH_NEXT(ehci, dma) \
+		(cpu_to_hc32(ehci, (((u32) dma) & ~0x01f) | Q_TYPE_QH))
 
 /* for periodic/async schedules and qtd lists, mark end of list */
 #define EHCI_LIST_END(ehci)	cpu_to_hc32(ehci, 1) /* "null pointer" to hw */
-- 
2.6.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 7/9] usb: host: ehci.h: remove macros trailing semicolon
  2015-12-09 22:15 [PATCH 1/9] usb: host: ehci.h: remove space before comma Geyslan G. Bem
                   ` (4 preceding siblings ...)
  2015-12-09 22:15 ` [PATCH 6/9] usb: host: ehci.h: use space after comma Geyslan G. Bem
@ 2015-12-09 22:15 ` Geyslan G. Bem
  2015-12-09 22:15 ` [PATCH 8/9] usb: host: ehci.h: move pointer operator to name side Geyslan G. Bem
  2015-12-09 22:15 ` [PATCH 9/9] usb: host: ehci.h: move constant to right Geyslan G. Bem
  7 siblings, 0 replies; 10+ messages in thread
From: Geyslan G. Bem @ 2015-12-09 22:15 UTC (permalink / raw)
  To: peter.senna
  Cc: Geyslan G. Bem, Alan Stern, Greg Kroah-Hartman, linux-usb, linux-kernel

Removes trailing semicolon from macros.

Caught by cppcheck:
"WARNING: macros should not use a trailing semicolon"

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 drivers/usb/host/ehci.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index ea56147..15de5bf 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -635,10 +635,10 @@ struct ehci_tt {
 /* Prepare the PORTSC wakeup flags during controller suspend/resume */
 
 #define ehci_prepare_ports_for_controller_suspend(ehci, do_wakeup)	\
-		ehci_adjust_port_wakeup_flags(ehci, true, do_wakeup);
+		ehci_adjust_port_wakeup_flags(ehci, true, do_wakeup)
 
 #define ehci_prepare_ports_for_controller_resume(ehci)			\
-		ehci_adjust_port_wakeup_flags(ehci, false, false);
+		ehci_adjust_port_wakeup_flags(ehci, false, false)
 
 /*-------------------------------------------------------------------------*/
 
-- 
2.6.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 8/9] usb: host: ehci.h: move pointer operator to name side
  2015-12-09 22:15 [PATCH 1/9] usb: host: ehci.h: remove space before comma Geyslan G. Bem
                   ` (5 preceding siblings ...)
  2015-12-09 22:15 ` [PATCH 7/9] usb: host: ehci.h: remove macros trailing semicolon Geyslan G. Bem
@ 2015-12-09 22:15 ` Geyslan G. Bem
  2015-12-09 22:15 ` [PATCH 9/9] usb: host: ehci.h: move constant to right Geyslan G. Bem
  7 siblings, 0 replies; 10+ messages in thread
From: Geyslan G. Bem @ 2015-12-09 22:15 UTC (permalink / raw)
  To: peter.senna
  Cc: Geyslan G. Bem, Alan Stern, Greg Kroah-Hartman, linux-usb, linux-kernel

The pointer operator must be sticked to name.

Caught by cppcheck:
ERROR: "foo * bar" should be "foo *bar"

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 drivers/usb/host/ehci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 15de5bf..81e609a 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -732,7 +732,7 @@ ehci_port_speed(struct ehci_hcd *ehci, unsigned int portsc)
 #endif
 
 static inline unsigned int ehci_readl(const struct ehci_hcd *ehci,
-		__u32 __iomem * regs)
+		__u32 __iomem *regs)
 {
 #ifdef CONFIG_USB_EHCI_BIG_ENDIAN_MMIO
 	return ehci_big_endian_mmio(ehci) ?
-- 
2.6.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 9/9] usb: host: ehci.h: move constant to right
  2015-12-09 22:15 [PATCH 1/9] usb: host: ehci.h: remove space before comma Geyslan G. Bem
                   ` (6 preceding siblings ...)
  2015-12-09 22:15 ` [PATCH 8/9] usb: host: ehci.h: move pointer operator to name side Geyslan G. Bem
@ 2015-12-09 22:15 ` Geyslan G. Bem
  2015-12-10 10:23   ` Peter Senna Tschudin
  7 siblings, 1 reply; 10+ messages in thread
From: Geyslan G. Bem @ 2015-12-09 22:15 UTC (permalink / raw)
  To: peter.senna
  Cc: Geyslan G. Bem, Alan Stern, Greg Kroah-Hartman, linux-usb, linux-kernel

This patch moves the constant 0x3ff to right and put spaces
in the right shift.

Caught by coccinelle:
scripts/coccinelle/misc/compare_const_fl.cocci

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 drivers/usb/host/ehci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 81e609a..de94555 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -555,7 +555,7 @@ struct ehci_sitd {
 	__hc32			hw_results;		/* EHCI table 3-11 */
 #define	SITD_IOC	(1 << 31)	/* interrupt on completion */
 #define	SITD_PAGE	(1 << 30)	/* buffer 0/1 */
-#define	SITD_LENGTH(x)	(0x3ff & ((x)>>16))
+#define	SITD_LENGTH(x)	(((x) >> 16) & 0x3ff)
 #define	SITD_STS_ACTIVE	(1 << 7)	/* HC may execute this */
 #define	SITD_STS_ERR	(1 << 6)	/* error from TT */
 #define	SITD_STS_DBE	(1 << 5)	/* data buffer error (in HC) */
-- 
2.6.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 9/9] usb: host: ehci.h: move constant to right
  2015-12-09 22:15 ` [PATCH 9/9] usb: host: ehci.h: move constant to right Geyslan G. Bem
@ 2015-12-10 10:23   ` Peter Senna Tschudin
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Senna Tschudin @ 2015-12-10 10:23 UTC (permalink / raw)
  To: Geyslan G. Bem; +Cc: Alan Stern, Greg Kroah-Hartman, linux-usb, linux-kernel

On Wed, Dec 09, 2015 at 07:15:37PM -0300, Geyslan G. Bem wrote:
> This patch moves the constant 0x3ff to right and put spaces
> in the right shift.
> 
> Caught by coccinelle:
> scripts/coccinelle/misc/compare_const_fl.cocci
> 
> Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
Acked-by: Peter Senna Tschudin <peter.senna@gmail.com>
> ---
>  drivers/usb/host/ehci.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
> index 81e609a..de94555 100644
> --- a/drivers/usb/host/ehci.h
> +++ b/drivers/usb/host/ehci.h
> @@ -555,7 +555,7 @@ struct ehci_sitd {
>  	__hc32			hw_results;		/* EHCI table 3-11 */
>  #define	SITD_IOC	(1 << 31)	/* interrupt on completion */
>  #define	SITD_PAGE	(1 << 30)	/* buffer 0/1 */
> -#define	SITD_LENGTH(x)	(0x3ff & ((x)>>16))
> +#define	SITD_LENGTH(x)	(((x) >> 16) & 0x3ff)
>  #define	SITD_STS_ACTIVE	(1 << 7)	/* HC may execute this */
>  #define	SITD_STS_ERR	(1 << 6)	/* error from TT */
>  #define	SITD_STS_DBE	(1 << 5)	/* data buffer error (in HC) */
> -- 
> 2.6.3
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-12-10 10:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-09 22:15 [PATCH 1/9] usb: host: ehci.h: remove space before comma Geyslan G. Bem
2015-12-09 22:15 ` [PATCH 2/9] usb: host: ehci.h: remove space before function open parenthesis Geyslan G. Bem
2015-12-09 22:15 ` [PATCH 3/9] usb: host: ehci.h: remove space before open square bracket Geyslan G. Bem
2015-12-09 22:15 ` [PATCH 4/9] usb: host: ehci.h: fix single statement macros Geyslan G. Bem
2015-12-09 22:15 ` [PATCH 5/9] usb: host: ehci.h: remove direct use of __attribute__ keyword Geyslan G. Bem
2015-12-09 22:15 ` [PATCH 6/9] usb: host: ehci.h: use space after comma Geyslan G. Bem
2015-12-09 22:15 ` [PATCH 7/9] usb: host: ehci.h: remove macros trailing semicolon Geyslan G. Bem
2015-12-09 22:15 ` [PATCH 8/9] usb: host: ehci.h: move pointer operator to name side Geyslan G. Bem
2015-12-09 22:15 ` [PATCH 9/9] usb: host: ehci.h: move constant to right Geyslan G. Bem
2015-12-10 10:23   ` Peter Senna Tschudin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.