Skip to contentSkip to conversation

Staging: octeon-usb: Fixes and Coding style applied.

PATCH Superseded Georgios Tsotsos 2 participants 6 messages Jul 24, 2018 – Jul 25, 2018 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Staging: octeon-usb: Fixes and Coding style applied.

Hello,

Previously patches were sent with wrong cover format, please ignore.

I am sending four patches which trying to resolve TODO list requirements no 45 about octeon-usb.
There are SPDX licence additions on c and header files.
Checkpatch warnings are resolved,also a notice about CVMX_WAIT_FOR_FIELD32 macro. It could improve readability and maintenance of this module if function cvmx_usb_poll_channel() break down (and probably some others too)

Georgios Tsotsos (4):
Staging: octeon-usb: Adds SPDX License Identifier
Staging: octeon-usb: Applying coding style for column width.
Staging: octeon-usb: Change coding style for CVMX_WAIT_FOR_FIELD32 marco.
Staging: octeon-usb: Adds SPDX License Identifier for header file

 drivers/staging/octeon-usb/octeon-hcd.c | 55 ++++++++++++++++++---------------
 drivers/staging/octeon-usb/octeon-hcd.h |  1 +
 2 files changed, 31 insertions(+), 25 deletions(-)
Signature · 1 line
2.16.4
#1 lore raw

PATCH 1/4 Staging: octeon-usb: Adds SPDX License Identifier

---
 drivers/staging/octeon-usb/octeon-hcd.c | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/octeon-usb/octeon-hcd.c +1 -0
index cded30f145aa..cff5e790b196 100644
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
Signature · 1 line
2.16.4
#2 lore raw

PATCH 2/4 Staging: octeon-usb: Applying coding style for column width.

In reply to Georgios Tsotsos

This patch resolves the warnings as its refereed to TODO list. There are also a code style issues that could be resolved via breaking down cvmx_usb_poll_channel().

---
 drivers/staging/octeon-usb/octeon-hcd.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/staging/octeon-usb/octeon-hcd.c +6 -4
index cff5e790b196..0d3ec12788fc 100644
@@ -2637,12 +2637,14 @@ static int cvmx_usb_poll_channel(struct octeon_hcd *usb, int channel)
 				hcintmsk.u32 = 0;
 				hcintmsk.s.chhltdmsk = 1;
 				cvmx_usb_write_csr32(usb,
-						     CVMX_USBCX_HCINTMSKX(channel, usb->index),
-						     hcintmsk.u32);
+						CVMX_USBCX_HCINTMSKX(channel,
+							usb->index),
+							hcintmsk.u32);
 				usbc_hcchar.s.chdis = 1;
 				cvmx_usb_write_csr32(usb,
-						     CVMX_USBCX_HCCHARX(channel, usb->index),
-						     usbc_hcchar.u32);
+						CVMX_USBCX_HCCHARX(channel,
+							usb->index),
+							usbc_hcchar.u32);
 				return 0;
 			} else if (usbc_hcint.s.xfercompl) {
 				/*
Signature · 1 line
2.16.4
#3 lore raw

PATCH 3/4 Staging: octeon-usb: Change coding style for CVMX_WAIT_FOR_FIELD32 marco.

In reply to Georgios Tsotsos

Changes coding style and encapsulate into parentheses timeout_usec.

---
 drivers/staging/octeon-usb/octeon-hcd.c | 44 +++++++++++++++++----------------
 1 file changed, 23 insertions(+), 21 deletions(-)
drivers/staging/octeon-usb/octeon-hcd.c +23 -21
index 0d3ec12788fc..84986252720d 100644
@@ -378,27 +378,29 @@ struct octeon_hcd {
 };
 
 /* This macro spins on a register waiting for it to reach a condition. */
-#define CVMX_WAIT_FOR_FIELD32(address, _union, cond, timeout_usec)	    \
-	({int result;							    \
-	do {								    \
-		u64 done = cvmx_get_cycle() + (u64)timeout_usec *	    \
-			   octeon_get_clock_rate() / 1000000;		    \
-		union _union c;						    \
-									    \
-		while (1) {						    \
-			c.u32 = cvmx_usb_read_csr32(usb, address);	    \
-									    \
-			if (cond) {					    \
-				result = 0;				    \
-				break;					    \
-			} else if (cvmx_get_cycle() > done) {		    \
-				result = -1;				    \
-				break;					    \
-			} else						    \
-				__delay(100);				    \
-		}							    \
-	} while (0);							    \
-	result; })
+#define CVMX_WAIT_FOR_FIELD32(address, _union, cond, timeout_usec)	\
+({									\
+	int result;							\
+	do {								\
+		u64 done = cvmx_get_cycle() + (u64)(timeout_usec) *	\
+			   octeon_get_clock_rate() / 1000000;		\
+		union _union c;						\
+									\
+		while (1) {						\
+			c.u32 = cvmx_usb_read_csr32(usb, address);	\
+									\
+			if (cond) {					\
+				result = 0;				\
+				break;					\
+			} else if (cvmx_get_cycle() > done) {		\
+				result = -1;				\
+				break;					\
+			} else						\
+				__delay(100);				\
+		}							\
+	} while (0);							\
+	result;								\
+})
 
 /*
  * This macro logically sets a single field in a CSR. It does the sequence
Signature · 1 line
2.16.4
#4 lore raw

PATCH 4/4 Staging: octeon-usb: Adds SPDX License Identifier for header file

In reply to Georgios Tsotsos
---
 drivers/staging/octeon-usb/octeon-hcd.h | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/octeon-usb/octeon-hcd.h +1 -0
index 3353aefe662e..769c36cf6614 100644
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Octeon HCD hardware register definitions.
  *
Signature · 1 line
2.16.4
#5 lore raw
In reply to Georgios Tsotsos
Quoted 10 lines · Georgios Tsotsos

Hello,

Previously patches were sent with wrong cover format, please ignore.

I am sending four patches which trying to resolve TODO list requirements no 45 about octeon-usb.
There are SPDX licence additions on c and header files.
Checkpatch warnings are resolved,also a notice about CVMX_WAIT_FOR_FIELD32 macro. It could improve readability and maintenance of this module if function cvmx_usb_poll_channel() break down (and probably some others too)

My same comments hold true for the "no changelog" patches :(

thanks,

greg k-h