From: Jagan Teki <jagan@amarulasolutions.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 06/32] spi: mpc8xxx: Rename camel-case variables
Date: Sun, 25 Nov 2018 22:58:27 +0530 [thread overview]
Message-ID: <20181125172853.20491-7-jagan@amarulasolutions.com> (raw)
In-Reply-To: <20181125172853.20491-1-jagan@amarulasolutions.com>
From: Mario Six <mario.six@gdsys.cc>
There are three variables that have camel-case names, which is not the
preferred naming style.
Give those variables more compliant names instead.
Signed-off-by: Mario Six <mario.six@gdsys.cc>
---
drivers/spi/mpc8xxx_spi.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c
index 3016cfe2ca..0393765b6f 100644
--- a/drivers/spi/mpc8xxx_spi.c
+++ b/drivers/spi/mpc8xxx_spi.c
@@ -77,9 +77,9 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din,
{
volatile spi8xxx_t *spi = &((immap_t *) (CONFIG_SYS_IMMR))->spi;
uint tmpdout, tmpdin, event;
- int numBlks = DIV_ROUND_UP(bitlen, 32);
- int tm, isRead = 0;
- uchar charSize = 32;
+ int num_blks = DIV_ROUND_UP(bitlen, 32);
+ int tm, is_read = 0;
+ uchar char_size = 32;
debug("spi_xfer: slave %u:%u dout %08X din %08X bitlen %u\n",
slave->bus, slave->cs, *(uint *) dout, *(uint *) din, bitlen);
@@ -91,12 +91,12 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din,
spi->event = 0xffffffff;
/* Handle data in 32-bit chunks */
- while (numBlks--) {
+ while (num_blks--) {
tmpdout = 0;
- charSize = (bitlen >= 32 ? 32 : bitlen);
+ char_size = (bitlen >= 32 ? 32 : bitlen);
/* Shift data so it's msb-justified */
- tmpdout = *(u32 *) dout >> (32 - charSize);
+ tmpdout = *(u32 *) dout >> (32 - char_size);
/* The LEN field of the SPMODE register is set as follows:
*
@@ -134,15 +134,15 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din,
* or time out (1 second = 1000 ms)
* The NE event must be read and cleared first
*/
- for (tm = 0, isRead = 0; tm < SPI_TIMEOUT; ++tm) {
+ for (tm = 0, is_read = 0; tm < SPI_TIMEOUT; ++tm) {
event = spi->event;
if (event & SPI_EV_NE) {
tmpdin = spi->rx;
spi->event |= SPI_EV_NE;
- isRead = 1;
+ is_read = 1;
- *(u32 *) din = (tmpdin << (32 - charSize));
- if (charSize == 32) {
+ *(u32 *) din = (tmpdin << (32 - char_size));
+ if (char_size == 32) {
/* Advance output buffer by 32 bits */
din += 4;
}
@@ -153,7 +153,7 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din,
* in the future put an arbitrary delay after writing
* the device. Arbitrary delays suck, though...
*/
- if (isRead && (event & SPI_EV_NF))
+ if (is_read && (event & SPI_EV_NF))
break;
}
if (tm >= SPI_TIMEOUT)
--
2.18.0.321.gffc6fa0e3
next prev parent reply other threads:[~2018-11-25 17:28 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-25 17:28 [U-Boot] [PATCH v2 00/32] spi: DM_SPI migration timeout, remainder(2) Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 01/32] spi: davinci: Full dm conversion Jagan Teki
2018-11-26 13:32 ` Adam Ford
2018-11-26 18:19 ` Jagan Teki
2018-11-26 19:12 ` Adam Ford
2018-11-25 17:28 ` [U-Boot] [PATCH v2 02/32] spi: kirkwood: " Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 03/32] spi: ti_qspi: " Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 04/32] spi: mpc8xxx: Use short type names Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 05/32] spi: mpc8xxx: Fix comments Jagan Teki
2018-11-25 17:28 ` Jagan Teki [this message]
2018-11-25 17:28 ` [U-Boot] [PATCH v2 07/32] spi: mpc8xxx: Fix space after cast Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 08/32] spi: mpc8xxx: Fix function names in strings Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 09/32] spi: mpc8xxx: Replace defines with enums Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 10/32] spi: mpc8xxx: Use IO accessors Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 11/32] spi: mpc8xxx: Simplify if Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 12/32] spi: mpc8xxx: Get rid of is_read Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 13/32] spi: mpc8xxx: Simplify logic a bit Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 14/32] spi: mpc8xxx: Reduce scope of loop variables Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 15/32] spi: mpc8xxx: Make code more readable Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 16/32] spi: mpc8xxx: Rename variable Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 17/32] spi: mpc8xxx: Document LEN setting better Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 18/32] spi: mpc8xxx: Re-order transfer setup Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 19/32] spi: mpc8xxx: Fix if check Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 20/32] spi: mpc8xxx: Use get_timer Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 21/32] spi: mpc8xxx: Convert to DM Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 22/32] spi: Zap cf_spi driver-related code Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 23/32] spi: Zap lpc32xx_ssp " Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 24/32] spi: Zap mxs_spi " Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 25/32] spi: Zap sh_spi " Jagan Teki
2018-11-25 18:06 ` Marek Vasut
2018-11-27 6:05 ` Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 26/32] spi: Zap soft_spi_legacy " Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 27/32] spi: mxc: Drop non-dm code Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 28/32] spi: omap3: " Jagan Teki
2018-11-26 19:36 ` Adam Ford
2018-11-25 17:28 ` [U-Boot] [PATCH v2 29/32] spi: atmel: " Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 30/32] spi: Zap fsl_espi driver-related code Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 31/32] spi: fsl_dspi: Drop non-dm code Jagan Teki
2018-11-25 17:28 ` [U-Boot] [PATCH v2 32/32] dm: MIGRATION: spi: Update SPI driver status Jagan Teki
2018-12-11 1:03 ` Simon Glass
2018-11-26 7:18 ` [U-Boot] [PATCH v2 00/32] spi: DM_SPI migration timeout, remainder(2) Peng Fan
2018-11-27 5:51 ` Jagan Teki
2018-11-27 12:10 ` Marek Vasut
2018-11-28 4:24 ` Heiko Schocher
2018-11-28 4:36 ` Tom Rini
2018-11-27 14:39 ` Stefano Babic
2018-11-27 16:13 ` Tom Rini
2018-11-28 9:33 ` Stefano Babic
2018-11-28 14:59 ` Tom Rini
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=20181125172853.20491-7-jagan@amarulasolutions.com \
--to=jagan@amarulasolutions.com \
--cc=u-boot@lists.denx.de \
/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