Skip to contentSkip to conversation

usb: host: ehci.h: remove space before comma

PATCH In review Geyslan G. Bem 4 participants 28 messages Dec 9, 2015 – Dec 10, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: host: ehci.h: remove space before comma

Get rid of spaces before comma.

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

---
 drivers/usb/host/ehci.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/usb/host/ehci.h +4 -4
index ec61aed..6a36ef4 100644
@@ -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
Signature · 1 line
2.6.3
#1 lore raw

PATCH 1/1 usb: host: ehci.h: remove space before function open parenthesis

Get rid of space between function name and open parenthesis.

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

---
 drivers/usb/host/ehci.h | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/usb/host/ehci.h +11 -11
index 6a36ef4..46982df 100644
@@ -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);
 }
Signature · 1 line
2.6.3
Acked-by on v1 1/1
#2 lore raw

Re: [PATCH 2/9v2] usb: host: ehci.h: remove space before function open parenthesis

Quoted 7 lines · Geyslan G. Bem

Get rid of space between function name and open parenthesis.

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

---

As with previous, missing the changelog here, but other than that the patch looks good to me.

Quoted 87 lines
 drivers/usb/host/ehci.h | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/usb/host/ehci.h +11 -11
index 6a36ef4..46982df 100644
@@ -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);
 }
Signature · 1 line
2.6.3
#3 lore raw

PATCH 1/1 usb: host: ehci.h: remove space before open square bracket

In reply to Geyslan G. Bem

Get rid of space before open square bracket.

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

---
 drivers/usb/host/ehci.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/usb/host/ehci.h +10 -10
index 46982df..cfeebd8 100644
@@ -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;
Signature · 1 line
2.6.3
Acked-by on v1 1/1
#4 lore raw

Re: [PATCH 3/9v2] usb: host: ehci.h: remove space before open square bracket

Quoted 6 lines · Geyslan G. Bem

Get rid of space before open square bracket.

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

As with previous, missing the changelog, but other than that the patch looks good to me.

Quoted 74 lines
---
 drivers/usb/host/ehci.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/usb/host/ehci.h +10 -10
index 46982df..cfeebd8 100644
@@ -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;
Signature · 1 line
2.6.3
#5 lore raw

PATCH 1/1 usb: host: ehci.h: fix single statement macros

In reply to Geyslan G. Bem

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

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

---
 drivers/usb/host/ehci.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/host/ehci.h +2 -2
index cfeebd8..945000a 100644
@@ -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 */
Signature · 1 line
2.6.3
Acked-by on v1 1/1
#6 lore raw

Re: [PATCH 4/9v2] usb: host: ehci.h: fix single statement macros

Quoted 6 lines · Geyslan G. Bem

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

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

As with previous, missing the changelog, but other than that the patch looks good to me.

Quoted 23 lines
---
 drivers/usb/host/ehci.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/host/ehci.h +2 -2
index cfeebd8..945000a 100644
@@ -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 */
Signature · 1 line
2.6.3
#7 lore raw

Re: [PATCH 4/9v2] usb: host: ehci.h: fix single statement macros

In reply to Geyslan G. Bem

Hello.

Quoted 15 lines · Geyslan G. Bem

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

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

---
  drivers/usb/host/ehci.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/host/ehci.h +0 -0
index cfeebd8..945000a 100644

drivers/usb/host/ehci.h struct ehci_hcd { /* one per controller */ · line 249

Quoted 8 lines
drivers/usb/host/ehci.h +2 -2
@@ -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)

Why not just empty #define?

[...]

MBR, Sergei

#8 lore raw

Re: [PATCH 4/9v2] usb: host: ehci.h: fix single statement macros

2015-12-10 8:54 GMT-03:00 Sergei Shtylyov <[email protected]>:

Quoted 23 lines

Hello.

Quoted 19 lines · Geyslan G. Bem

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

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

---
  drivers/usb/host/ehci.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/host/ehci.h +0 -0
index cfeebd8..945000a 100644
@@ -244,9 +244,9 @@ struct ehci_hcd {                   /* one per

controller */

        /* irq statistics */
  #ifdef EHCI_STATS
        struct ehci_stats       stats;
Quoted 8 lines

drivers/usb/host/ehci.h struct ehci_hcd { /* one per controller */ · line 249

Quoted 5 lines
drivers/usb/host/ehci.h +2 -2
-#      define COUNT(x) do { (x)++; } while (0)
+#      define COUNT(x) ((x)++)
  #else
-#      define COUNT(x) do {} while (0)
+#      define COUNT(x) ((void) 0)

Why not just empty #define?

Indeed. I'll change it.
Tks Sergei.

Quoted 5 lines

[...]

MBR, Sergei

Signature · 4 lines
Regards,

Geyslan G. Bem
hackingbits.com
#9 lore raw

Re: [PATCH 4/9v2] usb: host: ehci.h: fix single statement macros

2015-12-10 9:20 GMT-03:00 Geyslan G. Bem <[email protected]>:

Quoted 33 lines

2015-12-10 8:54 GMT-03:00 Sergei Shtylyov <[email protected]>:

Quoted 23 lines

Hello.

Quoted 19 lines · Geyslan G. Bem

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

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

---
  drivers/usb/host/ehci.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/host/ehci.h +0 -0
index cfeebd8..945000a 100644
@@ -244,9 +244,9 @@ struct ehci_hcd {                   /* one per

controller */

        /* irq statistics */
  #ifdef EHCI_STATS
        struct ehci_stats       stats;
Quoted 8 lines

drivers/usb/host/ehci.h struct ehci_hcd { /* one per controller */ · line 249

Quoted 5 lines
drivers/usb/host/ehci.h +2 -2
-#      define COUNT(x) do { (x)++; } while (0)
+#      define COUNT(x) ((x)++)
  #else
-#      define COUNT(x) do {} while (0)
+#      define COUNT(x) ((void) 0)

Why not just empty #define?

Quoted 2 lines

Indeed. I'll change it.
Tks Sergei.

Since COUNT is not used to return the empty #define is ok. Another way is to use #define COUNT(x) (0) to get a 0 when necessary to read returns.

Quoted 15 lines
Quoted 7 lines

[...]

MBR, Sergei

--
Regards,

Geyslan G. Bem
hackingbits.com

Signature · 4 lines
Regards,

Geyslan G. Bem
hackingbits.com
#10 lore raw

Re: [PATCH 4/9v2] usb: host: ehci.h: fix single statement macros

Quoted 28 lines · Geyslan G. Bem
Quoted 28 lines
Quoted 27 lines
Quoted 19 lines

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

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

---
   drivers/usb/host/ehci.h | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/host/ehci.h +0 -0
index cfeebd8..945000a 100644
@@ -244,9 +244,9 @@ struct ehci_hcd {                   /* one per

controller */

         /* irq statistics */
   #ifdef EHCI_STATS
         struct ehci_stats       stats;

drivers/usb/host/ehci.h struct ehci_hcd { /* one per controller */ · line 249

Quoted 5 lines
drivers/usb/host/ehci.h +2 -2
-#      define COUNT(x) do { (x)++; } while (0)
+#      define COUNT(x) ((x)++)
   #else
-#      define COUNT(x) do {} while (0)
+#      define COUNT(x) ((void) 0)

Why not just empty #define?

Quoted 6 lines
Quoted 2 lines

Indeed. I'll change it.
Tks Sergei.

Since COUNT is not used to return the empty #define is ok. Another way is to use #define COUNT(x) (0) to get a 0 when necessary to read returns.

Just 0, no parens please.

MBR, Sergei

#11 lore raw

Re: [PATCH 4/9v2] usb: host: ehci.h: fix single statement macros

2015-12-10 11:44 GMT-03:00 Sergei Shtylyov <[email protected]>:

Quoted 36 lines · Geyslan G. Bem
Quoted 35 lines
Quoted 33 lines
Quoted 21 lines
Quoted 21 lines

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

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

---
   drivers/usb/host/ehci.h | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/host/ehci.h +0 -0
index cfeebd8..945000a 100644
@@ -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)

Quoted 8 lines

drivers/usb/host/ehci.h struct ehci_hcd { /* one per controller */ · line 249

Quoted 4 lines
drivers/usb/host/ehci.h +2 -1
+#      define COUNT(x) ((x)++)
   #else
-#      define COUNT(x) do {} while (0)
+#      define COUNT(x) ((void) 0)

Why not just empty #define?

Indeed. I'll change it.
Tks Sergei.

Quoted 6 lines
Quoted 3 lines

Since COUNT is not used to return the empty #define is ok. Another way is to use #define COUNT(x) (0) to get a 0 when necessary to read returns.

Just 0, no parens please.

Ok, no parens, since there's no evaluation.

Then my change is:

-# define COUNT(x) do { (x)++; } while (0)
+# define COUNT(x) (++(x))
#else
-# define COUNT(x) do {} while (0)
+# define COUNT(x) 0

Pre-increment allowing to return the updated x.

Quoted 3 lines

MBR, Sergei

Signature · 4 lines
Regards,

Geyslan G. Bem
hackingbits.com
#12 lore raw

Re: [PATCH 4/9v2] usb: host: ehci.h: fix single statement macros

Quoted 34 lines · Geyslan G. Bem
Quoted 34 lines
Quoted 34 lines
Quoted 32 lines
Quoted 20 lines
Quoted 20 lines

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

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

---
    drivers/usb/host/ehci.h | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/host/ehci.h +0 -0
index cfeebd8..945000a 100644
@@ -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)

Quoted 8 lines

drivers/usb/host/ehci.h struct ehci_hcd { /* one per controller */ · line 249

Quoted 4 lines
drivers/usb/host/ehci.h +2 -1
+#      define COUNT(x) ((x)++)
    #else
-#      define COUNT(x) do {} while (0)
+#      define COUNT(x) ((void) 0)

Why not just empty #define?

Indeed. I'll change it.
Tks Sergei.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Since COUNT is not used to return the empty #define is ok. Another way is to use #define COUNT(x) (0) to get a 0 when necessary to read returns.

Just 0, no parens please.

Ok, no parens, since there's no evaluation.

It's because the literals don't need parens at all.

Quoted 9 lines

Then my change is:

drivers/usb/host/ehci.h +2 -2
-#      define COUNT(x) do { (x)++; } while (0)
+#      define COUNT(x) (++(x))
  #else
-#      define COUNT(x) do {} while (0)
+#      define COUNT(x) 0

Pre-increment allowing to return the updated x.

Why if there was a post-increment before?

Anyway, this talk is quite pointless since the macro didn't return any
value anyway.

MBR, Sergei

#13 lore raw

Re: [PATCH 4/9v2] usb: host: ehci.h: fix single statement macros

2015-12-10 14:26 GMT-03:00 Sergei Shtylyov <[email protected]>:

Quoted 60 lines · Geyslan G. Bem
Quoted 43 lines
Quoted 41 lines
Quoted 41 lines
Quoted 33 lines
Quoted 22 lines
Quoted 22 lines

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

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

---
    drivers/usb/host/ehci.h | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/host/ehci.h +0 -0
index cfeebd8..945000a 100644
@@ -244,9 +244,9 @@ struct ehci_hcd {                   /* one per

controller */

          /* irq statistics */
    #ifdef EHCI_STATS
          struct ehci_stats       stats;
drivers/usb/host/ehci.h +1 -1
-#      define COUNT(x) do { (x)++; } while (0)
+#      define COUNT(x) ((x)++)
Quoted 8 lines

drivers/usb/host/ehci.h

Quoted 3 lines
    #else
drivers/usb/host/ehci.h +1 -1
-#      define COUNT(x) do {} while (0)
+#      define COUNT(x) ((void) 0)

Why not just empty #define?

Quoted 2 lines

Indeed. I'll change it.
Tks Sergei.

Since COUNT is not used to return the empty #define is ok. Another way is to use #define COUNT(x) (0) to get a 0 when necessary to read returns.

Quoted 4 lines
Quoted 1 line

Just 0, no parens please.

Ok, no parens, since there's no evaluation.

It's because the literals don't need parens at all.

Quoted 8 lines

Then my change is:

(quoted diff) +2 -2
-#      define COUNT(x) do { (x)++; } while (0)
+#      define COUNT(x) (++(x))
  #else
-#      define COUNT(x) do {} while (0)
+#      define COUNT(x) 0
Quoted 4 lines
Quoted 1 line

Pre-increment allowing to return the updated x.

Why if there was a post-increment before?

There's nothing wrong with post-increment. The pre one would be necessary if using return.

Quoted 3 lines

Anyway, this talk is quite pointless since the macro didn't return any
value anyway.

You're sure, there's no use anywhere of the return of that macro indeed.

Sending v2 soon.

Quoted 3 lines

MBR, Sergei

Signature · 4 lines
Regards,

Geyslan G. Bem
hackingbits.com
#14 lore raw

Re: [PATCH 4/9v2] usb: host: ehci.h: fix single statement macros

Quoted 48 lines · Geyslan G. Bem
Quoted 48 lines
Quoted 30 lines
Quoted 30 lines
Quoted 30 lines
Quoted 29 lines
Quoted 10 lines
Quoted 10 lines

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

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

---
     drivers/usb/host/ehci.h | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 16 lines
Quoted 9 lines
drivers/usb/host/ehci.h +0 -0
index cfeebd8..945000a 100644
@@ -244,9 +244,9 @@ struct ehci_hcd {                   /* one per

controller */

           /* irq statistics */
     #ifdef EHCI_STATS
           struct ehci_stats       stats;

drivers/usb/host/ehci.h

Quoted 5 lines
drivers/usb/host/ehci.h +2 -2
-#      define COUNT(x) do { (x)++; } while (0)
+#      define COUNT(x) ((x)++)
     #else
-#      define COUNT(x) do {} while (0)
+#      define COUNT(x) ((void) 0)

Why not just empty #define?

Indeed. I'll change it.
Tks Sergei.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Since COUNT is not used to return the empty #define is ok. Another way is to use #define COUNT(x) (0) to get a 0 when necessary to read returns.

Just 0, no parens please.

Ok, no parens, since there's no evaluation.

It's because the literals don't need parens at all.

Quoted 8 lines

Then my change is:

(quoted diff) +2 -2
-#      define COUNT(x) do { (x)++; } while (0)
+#      define COUNT(x) (++(x))
   #else
-#      define COUNT(x) do {} while (0)
+#      define COUNT(x) 0
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Pre-increment allowing to return the updated x.

Why if there was a post-increment before?

There's nothing wrong with post-increment. The pre one would be necessary if using return.

Maybe it was intended to return the old value? :-)

Quoted 4 lines
Quoted 3 lines

Anyway, this talk is quite pointless since the macro didn't return any
value anyway.

You're sure, there's no use anywhere of the return of that macro indeed.

*do* {} *while* (0) just couldn't return any value, it's not just a
compound statement which gcc indeed allows to be evaluated.

Quoted 1 line

Sending v2 soon.

MBR, Sergei

#15 lore raw

Re: [PATCH 4/9v2] usb: host: ehci.h: fix single statement macros

2015-12-10 14:47 GMT-03:00 Sergei Shtylyov <[email protected]>:

Quoted 75 lines · Geyslan G. Bem
Quoted 63 lines
Quoted 56 lines
Quoted 40 lines
Quoted 38 lines
Quoted 38 lines
Quoted 31 lines
Quoted 21 lines
Quoted 21 lines

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

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

---
     drivers/usb/host/ehci.h | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/host/ehci.h +0 -0
index cfeebd8..945000a 100644
@@ -244,9 +244,9 @@ struct ehci_hcd {                   /* one per

controller */

           /* irq statistics */
     #ifdef EHCI_STATS
           struct ehci_stats       stats;
Quoted 8 lines

drivers/usb/host/ehci.h

Quoted 5 lines
drivers/usb/host/ehci.h +2 -2
-#      define COUNT(x) do { (x)++; } while (0)
+#      define COUNT(x) ((x)++)
     #else
-#      define COUNT(x) do {} while (0)
+#      define COUNT(x) ((void) 0)

Why not just empty #define?

Quoted 2 lines

Indeed. I'll change it.
Tks Sergei.

Since COUNT is not used to return the empty #define is ok. Another way is to use #define COUNT(x) (0) to get a 0 when necessary to read returns.

Quoted 4 lines
Quoted 1 line

Just 0, no parens please.

Ok, no parens, since there's no evaluation.

It's because the literals don't need parens at all.

Quoted 8 lines

Then my change is:

(quoted diff) +2 -2
-#      define COUNT(x) do { (x)++; } while (0)
+#      define COUNT(x) (++(x))
   #else
-#      define COUNT(x) do {} while (0)
+#      define COUNT(x) 0
Quoted 5 lines
Quoted 1 line

Pre-increment allowing to return the updated x.

Why if there was a post-increment before?

Quoted 2 lines

There's nothing wrong with post-increment. The pre one would be necessary if using return.

Maybe it was intended to return the old value? :-)

Quoted 5 lines
Quoted 4 lines

Anyway, this talk is quite pointless since the macro didn't return
any
value anyway.

Quoted 5 lines
Quoted 1 line

You're sure, there's no use anywhere of the return of that macro indeed.

*do* {} *while* (0) just couldn't return any value, it's not just a
compound statement which gcc indeed allows to be evaluated.

Indeed. :-)

v2 in the oven.

Quoted 7 lines
Quoted 3 lines

Sending v2 soon.

MBR, Sergei

Signature · 4 lines
Regards,

Geyslan G. Bem
hackingbits.com
#16 lore raw

PATCH 1/1 usb: host: ehci.h: remove direct use of __attribute__ keyword

In reply to Geyslan G. Bem

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

Caught by checkpatch: "WARNING"

---
 drivers/usb/host/ehci.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/usb/host/ehci.h +5 -5
index 945000a..7b2b213 100644
@@ -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);
 
 /*-------------------------------------------------------------------------*/
 
Signature · 1 line
2.6.3
Acked-by on v1 1/1
#17 lore raw

Re: [PATCH 5/9v2] usb: host: ehci.h: remove direct use of __attribute__ keyword

Quoted 4 lines · Geyslan G. Bem

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

Caught by checkpatch: "WARNING"

Not sure about the WARNING here, maybe just remove this line?

Quoted 2 lines

As with previous, missing the changelog, but other than that the patch looks good to me.

Quoted 56 lines
---
 drivers/usb/host/ehci.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/usb/host/ehci.h +5 -5
index 945000a..7b2b213 100644
@@ -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);
 
 /*-------------------------------------------------------------------------*/
 
Signature · 1 line
2.6.3
#18 lore raw

Re: [PATCH 5/9v2] usb: host: ehci.h: remove direct use of __attribute__ keyword

2015-12-10 7:01 GMT-03:00 Peter Senna Tschudin <[email protected]>:

Quoted 6 lines · Geyslan G. Bem
Quoted 4 lines

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

Caught by checkpatch: "WARNING"

Not sure about the WARNING here, maybe just remove this line?

Or just to be changed to "Caught by checkpatch."

Quoted 63 lines
Quoted 3 lines

As with previous, missing the changelog, but other than that the patch looks good to me.

Quoted 56 lines
---
 drivers/usb/host/ehci.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/usb/host/ehci.h +5 -6
index 945000a..7b2b213 100644
@@ -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

Signature · 4 lines
Regards,

Geyslan G. Bem
hackingbits.com
#19 lore raw

PATCH 1/1 usb: host: ehci.h: use space after comma

In reply to Geyslan G. Bem

Put space after comma.

This patch also changes QH_NEXT macro for better reading.

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

---
 drivers/usb/host/ehci.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/usb/host/ehci.h +3 -2
index 7b2b213..ea56147 100644
@@ -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 */
Signature · 1 line
2.6.3
#20 lore raw

Re: [PATCH 6/9v2] usb: host: ehci.h: use space after comma

Quoted 25 lines · Geyslan G. Bem

Put space after comma.

This patch also changes QH_NEXT macro for better reading.

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

---
 drivers/usb/host/ehci.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/usb/host/ehci.h +1 -1
index 7b2b213..ea56147 100644
@@ -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

drivers/usb/host/ehci.h struct ehci_qtd { · line 354

Quoted 6 lines
drivers/usb/host/ehci.h +2 -1
@@ -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 the maintainers: Is having two lines here better than having a line with 83 chars?

Quoted 6 lines
drivers/usb/host/ehci.h +0 -0
 /* 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 */
Signature · 1 line
2.6.3
maintainer
#21 lore raw

Re: [PATCH 6/9v2] usb: host: ehci.h: use space after comma

Quoted 6 lines · Peter Senna Tschudin

drivers/usb/host/ehci.h struct ehci_qtd { · line 354

Quoted 4 lines

/* next async queue entry, or pointer to interrupt/periodic QH */

drivers/usb/host/ehci.h +2 -1
-#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 the maintainers: Is having two lines here better than having a line with 83 chars?

Two lines is better. This patch is fine and so are the other 7 -- I never received 9/9v2 (the original 9/9 was okay).

Alan Stern

#22 lore raw

Re: [PATCH 6/9v2] usb: host: ehci.h: use space after comma

2015-12-10 12:57 GMT-03:00 Alan Stern <[email protected]>:

Quoted 11 lines · Peter Senna Tschudin
Quoted 7 lines

drivers/usb/host/ehci.h struct ehci_qtd { · line 354

Quoted 5 lines

/* next async queue entry, or pointer to interrupt/periodic QH */

drivers/usb/host/ehci.h +2 -1
-#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 the maintainers: Is having two lines here better than having a line with 83 chars?

Two lines is better. This patch is fine and so are the other 7 -- I never received 9/9v2 (the original 9/9 was okay).

Alan,

The 9 is v1 only, since it mentions the tool (coccinelle) correctly.

Tks.

Quoted 3 lines

Alan Stern

Signature · 4 lines
Regards,

Geyslan G. Bem
hackingbits.com
#23 lore raw

PATCH 1/1 usb: host: ehci.h: remove macros trailing semicolon

In reply to Geyslan G. Bem

Removes trailing semicolon from macros.

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

---
 drivers/usb/host/ehci.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/host/ehci.h +2 -2
index ea56147..15de5bf 100644
@@ -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)
 
 /*-------------------------------------------------------------------------*/
 
Signature · 1 line
2.6.3
Acked-by on v1 1/1
#24 lore raw

Re: [PATCH 7/9v2] usb: host: ehci.h: remove macros trailing semicolon

Quoted 6 lines · Geyslan G. Bem

Removes trailing semicolon from macros.

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

As with previous, missing the changelog, but other than that the patch looks good to me.

Quoted 24 lines
---
 drivers/usb/host/ehci.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/host/ehci.h +2 -2
index ea56147..15de5bf 100644
@@ -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)
 
 /*-------------------------------------------------------------------------*/
 
Signature · 1 line
2.6.3
#25 lore raw

PATCH 1/1 usb: host: ehci.h: move pointer operator to name side

In reply to Geyslan G. Bem

The pointer operator must be sticked to name.

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

---
 drivers/usb/host/ehci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/ehci.h +1 -1
index 15de5bf..81e609a 100644
@@ -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) ?
Signature · 1 line
2.6.3
Acked-by on v1 1/1
#26 lore raw

Re: [PATCH 8/9v2] usb: host: ehci.h: move pointer operator to name side

Quoted 6 lines · Geyslan G. Bem

The pointer operator must be sticked to name.

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

As with previous, missing the changelog, but other than that the patch looks good to me.

Quoted 20 lines
---
 drivers/usb/host/ehci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/ehci.h +1 -1
index 15de5bf..81e609a 100644
@@ -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) ?
Signature · 1 line
2.6.3
Acked-by on v1 1/1
#27 lore raw
In reply to Geyslan G. Bem
Quoted 6 lines · Geyslan G. Bem

Get rid of spaces before comma.

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

---

It is a good idea to include here (after the ---) what changed from V1. Other than that:

Not related to this patch, I did not receive patch 9/9v2.

Quoted 28 lines
 drivers/usb/host/ehci.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/usb/host/ehci.h +4 -4
index ec61aed..6a36ef4 100644
@@ -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
Signature · 1 line
2.6.3