linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Georgios Tsotsos <tsotsos@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Georgios Tsotsos <tsotsos@gmail.com>,
	Aaro Koskinen <aaro.koskinen@iki.fi>,
	James Hogan <jhogan@kernel.org>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/4] Staging: octeon-usb: Change coding style for CVMX_WAIT_FOR_FIELD32 marco.
Date: Wed, 25 Jul 2018 01:22:10 +0300	[thread overview]
Message-ID: <20180724222212.8742-4-tsotsos@gmail.com> (raw)
In-Reply-To: <20180724222212.8742-1-tsotsos@gmail.com>

Changes coding style and encapsulate into parentheses timeout_usec.

Signed-off-by: Georgios Tsotsos <tsotsos@gmail.com>
---
 drivers/staging/octeon-usb/octeon-hcd.c | 44 +++++++++++++++++----------------
 1 file changed, 23 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c
index 0d3ec12788fc..84986252720d 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.c
+++ b/drivers/staging/octeon-usb/octeon-hcd.c
@@ -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
-- 
2.16.4


  parent reply	other threads:[~2018-07-24 22:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180724222212.8742-1-tsotsos@gmail.com>
2018-07-24 22:22 ` [PATCH 1/4] Staging: octeon-usb: Adds SPDX License Identifier Georgios Tsotsos
2018-07-25  7:40   ` Greg Kroah-Hartman
2018-07-24 22:22 ` [PATCH 2/4] Staging: octeon-usb: Applying coding style for column width Georgios Tsotsos
2018-07-25  1:22   ` Joe Perches
2018-07-24 22:22 ` Georgios Tsotsos [this message]
2018-07-24 22:22 ` [PATCH 4/4] Staging: octeon-usb: Adds SPDX License Identifier for header file Georgios Tsotsos
2018-07-25  7:40   ` Greg Kroah-Hartman
2018-07-24 22:22 ` [PATCH 4/4] Staging: octeon-usb: Adds SPDX License Identifier Georgios Tsotsos
2018-07-25  7:40   ` Greg Kroah-Hartman
2018-07-25  7:39 ` your mail Greg Kroah-Hartman
2018-07-24 22:38 [PATCH 0/4] Staging: octeon-usb: Fixes and Coding style applied Georgios Tsotsos
2018-07-24 22:38 ` [PATCH 3/4] Staging: octeon-usb: Change coding style for CVMX_WAIT_FOR_FIELD32 marco Georgios Tsotsos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180724222212.8742-4-tsotsos@gmail.com \
    --to=tsotsos@gmail.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jhogan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).