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 v4 1/2] Staging: octeon-usb: Change multiple calling of CVMX_USBCX_GRSTCTL
Date: Sun, 29 Jul 2018 17:13:34 +0300 [thread overview]
Message-ID: <20180729141335.32501-1-tsotsos@gmail.com> (raw)
In-Reply-To: <20180729124400.GB27275@kroah.com>
Assign to variable the result of CVMX_USBCX_GRSTCTL instead of multiple
calling a macro.
Signed-off-by: Georgios Tsotsos <tsotsos@gmail.com>
---
v2: It wasn't exist in this or earlier versions of patch series
v3: It seems a logical to avoid multiple calls of CVMX_USBCX_GRSTCTL that will
also help cleaning up calls of CVMX_WAIT_FOR_FIELD32
v4: Added patch version text
drivers/staging/octeon-usb/octeon-hcd.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c
index cff5e790b196..4615133292b5 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.c
+++ b/drivers/staging/octeon-usb/octeon-hcd.c
@@ -598,6 +598,7 @@ static void cvmx_fifo_setup(struct octeon_hcd *usb)
union cvmx_usbcx_ghwcfg3 usbcx_ghwcfg3;
union cvmx_usbcx_gnptxfsiz npsiz;
union cvmx_usbcx_hptxfsiz psiz;
+ u64 address;
usbcx_ghwcfg3.u32 = cvmx_usb_read_csr32(usb,
CVMX_USBCX_GHWCFG3(usb->index));
@@ -629,17 +630,16 @@ static void cvmx_fifo_setup(struct octeon_hcd *usb)
psiz.s.ptxfstaddr = 3 * usbcx_ghwcfg3.s.dfifodepth / 4;
cvmx_usb_write_csr32(usb, CVMX_USBCX_HPTXFSIZ(usb->index), psiz.u32);
+ address = CVMX_USBCX_GRSTCTL(usb->index);
+
/* Flush all FIFOs */
- USB_SET_FIELD32(CVMX_USBCX_GRSTCTL(usb->index),
- cvmx_usbcx_grstctl, txfnum, 0x10);
- USB_SET_FIELD32(CVMX_USBCX_GRSTCTL(usb->index),
- cvmx_usbcx_grstctl, txfflsh, 1);
- CVMX_WAIT_FOR_FIELD32(CVMX_USBCX_GRSTCTL(usb->index),
- cvmx_usbcx_grstctl, c.s.txfflsh == 0, 100);
- USB_SET_FIELD32(CVMX_USBCX_GRSTCTL(usb->index),
- cvmx_usbcx_grstctl, rxfflsh, 1);
- CVMX_WAIT_FOR_FIELD32(CVMX_USBCX_GRSTCTL(usb->index),
- cvmx_usbcx_grstctl, c.s.rxfflsh == 0, 100);
+ USB_SET_FIELD32(address, cvmx_usbcx_grstctl, txfnum, 0x10);
+ USB_SET_FIELD32(address, cvmx_usbcx_grstctl, txfflsh, 1);
+ CVMX_WAIT_FOR_FIELD32(address, cvmx_usbcx_grstctl,
+ c.s.txfflsh == 0, 100);
+ USB_SET_FIELD32(address, cvmx_usbcx_grstctl, rxfflsh, 1);
+ CVMX_WAIT_FOR_FIELD32(address, cvmx_usbcx_grstctl,
+ c.s.rxfflsh == 0, 100);
}
/**
--
2.16.4
next prev parent reply other threads:[~2018-07-29 14:14 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-26 15:41 [PATCH v2 0/3] Staging: octeon-usb fixes for coding style, SPDX and readability Georgios Tsotsos
2018-07-26 13:30 ` [PATCH 1/3] Staging: octeon-usb: Adding SPDX license identifier Georgios Tsotsos
2018-07-26 15:41 ` [PATCH v2 " Georgios Tsotsos
2018-07-26 13:30 ` [PATCH 2/3] Staging: octeon-usb: Change coding style of CVMX_WAIT_FOR_FIELD32 marco Georgios Tsotsos
2018-07-26 15:41 ` [PATCH v2 " Georgios Tsotsos
2018-07-27 15:15 ` Greg Kroah-Hartman
2018-07-28 15:48 ` Georgios Tsotsos
2018-07-29 11:40 ` [PATCH v3 0/2] Staging: octeon-usb: Changed CVMX_WAIT_FOR_FIELD32 macro Georgios Tsotsos
2018-07-29 11:40 ` [PATCH v3 1/2] Staging: octeon-usb: Change multiple calling of CVMX_USBCX_GRSTCTL Georgios Tsotsos
2018-07-29 12:44 ` Greg Kroah-Hartman
2018-07-29 14:13 ` Georgios Tsotsos [this message]
2018-07-29 11:40 ` [PATCH v3 2/2] Staging: octeon-usb: Changes macro CVMX_WAIT_FOR_FIELD32 to function call Georgios Tsotsos
2018-07-29 19:27 ` Aaro Koskinen
2018-07-29 14:13 ` [PATCH v4 " Georgios Tsotsos
2018-07-26 13:30 ` [PATCH 3/3] Staging: octeon-usb: Breaks down cvmx_usb_poll_channel() Georgios Tsotsos
2018-07-26 15:41 ` [PATCH v2 " Georgios Tsotsos
2018-07-26 16:31 ` Joe Perches
2018-07-26 22:08 ` Georgios Tsotsos
2018-07-29 11:41 ` [PATCH v3 0/1] " Georgios Tsotsos
2018-07-29 11:41 ` [PATCH v3 1/1] " Georgios Tsotsos
2018-07-29 12:43 ` Greg Kroah-Hartman
2018-07-29 14:33 ` [PATCH v4 1/1] Staging: octeon-usb: Using defined error codes and applying coding style Georgios Tsotsos
2018-07-29 20:21 ` Aaro Koskinen
2018-07-29 21:17 ` Georgios Tsotsos
2018-07-29 22:29 ` [PATCH v5] " Georgios Tsotsos
2018-07-30 8:51 ` Greg Kroah-Hartman
2018-07-30 20:18 ` Georgios Tsotsos
2018-07-29 14:52 ` [PATCH v3 1/1] Staging: octeon-usb: Breaks down cvmx_usb_poll_channel() 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=20180729141335.32501-1-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 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.