mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Rapoport <mike.rapoport@gmail.com>
To: Greg Kroah-Hartman <greg@kroah.com>
Cc: Mike Rapoport <mike.rapoport@gmail.com>,
	Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	Teddy Wang <teddy.wang@siliconmotion.com>,
	Sudip Mukherjee <sudip@vectorindia.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH v3 15/17] staging: sm750fb: ddk750_swi2c: further reduce CamelCase
Date: Sun,  6 Sep 2015 09:18:05 +0300	[thread overview]
Message-ID: <1441520287-5232-16-git-send-email-mike.rapoport@gmail.com> (raw)
In-Reply-To: <1441520287-5232-1-git-send-email-mike.rapoport@gmail.com>

Rename remaining CamelCase variables

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
---
 drivers/staging/sm750fb/ddk750_swi2c.c | 122 ++++++++++++++++-----------------
 drivers/staging/sm750fb/ddk750_swi2c.h |  20 +++---
 2 files changed, 71 insertions(+), 71 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c b/drivers/staging/sm750fb/ddk750_swi2c.c
index 1d7e8f6..5cb1cf2 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -98,11 +98,11 @@ static void sw_i2c_wait(void)
        */
 	while (peekIO(0x3ce, 0x61) & 0x10);
 #else
-	int i, Temp;
+	int i, tmp;
 
 	for (i = 0; i < 600; i++) {
-		Temp = i;
-		Temp += i;
+		tmp = i;
+		tmp += i;
 	}
 #endif
 }
@@ -121,23 +121,23 @@ static void sw_i2c_wait(void)
  */
 static void sw_i2c_scl(unsigned char value)
 {
-	unsigned long ulGPIOData;
-	unsigned long ulGPIODirection;
+	unsigned long gpio_data;
+	unsigned long gpio_dir;
 
-	ulGPIODirection = PEEK32(sw_i2c_clk_gpio_data_dir_reg);
+	gpio_dir = PEEK32(sw_i2c_clk_gpio_data_dir_reg);
 	if (value) {    /* High */
 		/* Set direction as input. This will automatically pull the signal up. */
-		ulGPIODirection &= ~(1 << sw_i2c_clk_gpio);
-		POKE32(sw_i2c_clk_gpio_data_dir_reg, ulGPIODirection);
+		gpio_dir &= ~(1 << sw_i2c_clk_gpio);
+		POKE32(sw_i2c_clk_gpio_data_dir_reg, gpio_dir);
 	} else {        /* Low */
 		/* Set the signal down */
-		ulGPIOData = PEEK32(sw_i2c_clk_gpio_data_reg);
-		ulGPIOData &= ~(1 << sw_i2c_clk_gpio);
-		POKE32(sw_i2c_clk_gpio_data_reg, ulGPIOData);
+		gpio_data = PEEK32(sw_i2c_clk_gpio_data_reg);
+		gpio_data &= ~(1 << sw_i2c_clk_gpio);
+		POKE32(sw_i2c_clk_gpio_data_reg, gpio_data);
 
 		/* Set direction as output */
-		ulGPIODirection |= (1 << sw_i2c_clk_gpio);
-		POKE32(sw_i2c_clk_gpio_data_dir_reg, ulGPIODirection);
+		gpio_dir |= (1 << sw_i2c_clk_gpio);
+		POKE32(sw_i2c_clk_gpio_data_dir_reg, gpio_dir);
 	}
 }
 
@@ -155,23 +155,23 @@ static void sw_i2c_scl(unsigned char value)
  */
 static void sw_i2c_sda(unsigned char value)
 {
-	unsigned long ulGPIOData;
-	unsigned long ulGPIODirection;
+	unsigned long gpio_data;
+	unsigned long gpio_dir;
 
-	ulGPIODirection = PEEK32(sw_i2c_data_gpio_data_dir_reg);
+	gpio_dir = PEEK32(sw_i2c_data_gpio_data_dir_reg);
 	if (value) {    /* High */
 		/* Set direction as input. This will automatically pull the signal up. */
-		ulGPIODirection &= ~(1 << sw_i2c_data_gpio);
-		POKE32(sw_i2c_data_gpio_data_dir_reg, ulGPIODirection);
+		gpio_dir &= ~(1 << sw_i2c_data_gpio);
+		POKE32(sw_i2c_data_gpio_data_dir_reg, gpio_dir);
 	} else {        /* Low */
 		/* Set the signal down */
-		ulGPIOData = PEEK32(sw_i2c_data_gpio_data_reg);
-		ulGPIOData &= ~(1 << sw_i2c_data_gpio);
-		POKE32(sw_i2c_data_gpio_data_reg, ulGPIOData);
+		gpio_data = PEEK32(sw_i2c_data_gpio_data_reg);
+		gpio_data &= ~(1 << sw_i2c_data_gpio);
+		POKE32(sw_i2c_data_gpio_data_reg, gpio_data);
 
 		/* Set direction as output */
-		ulGPIODirection |= (1 << sw_i2c_data_gpio);
-		POKE32(sw_i2c_data_gpio_data_dir_reg, ulGPIODirection);
+		gpio_dir |= (1 << sw_i2c_data_gpio);
+		POKE32(sw_i2c_data_gpio_data_dir_reg, gpio_dir);
 	}
 }
 
@@ -183,19 +183,19 @@ static void sw_i2c_sda(unsigned char value)
  */
 static unsigned char sw_i2c_read_sda(void)
 {
-	unsigned long ulGPIODirection;
-	unsigned long ulGPIOData;
+	unsigned long gpio_dir;
+	unsigned long gpio_data;
 
 	/* Make sure that the direction is input (High) */
-	ulGPIODirection = PEEK32(sw_i2c_data_gpio_data_dir_reg);
-	if ((ulGPIODirection & (1 << sw_i2c_data_gpio)) != (~(1 << sw_i2c_data_gpio))) {
-		ulGPIODirection &= ~(1 << sw_i2c_data_gpio);
-		POKE32(sw_i2c_data_gpio_data_dir_reg, ulGPIODirection);
+	gpio_dir = PEEK32(sw_i2c_data_gpio_data_dir_reg);
+	if ((gpio_dir & (1 << sw_i2c_data_gpio)) != (~(1 << sw_i2c_data_gpio))) {
+		gpio_dir &= ~(1 << sw_i2c_data_gpio);
+		POKE32(sw_i2c_data_gpio_data_dir_reg, gpio_dir);
 	}
 
 	/* Now read the SDA line */
-	ulGPIOData = PEEK32(sw_i2c_data_gpio_data_reg);
-	if (ulGPIOData & (1 << sw_i2c_data_gpio))
+	gpio_data = PEEK32(sw_i2c_data_gpio_data_reg);
+	if (gpio_data & (1 << sw_i2c_data_gpio))
 		return 1;
 	else
 		return 0;
@@ -340,15 +340,15 @@ static unsigned char sw_i2c_read_byte(unsigned char ack)
  * This function initializes GPIO port for SW I2C communication.
  *
  * Parameters:
- *      i2cClkGPIO      - The GPIO pin to be used as i2c SCL
- *      i2cDataGPIO     - The GPIO pin to be used as i2c SDA
+ *      clk_gpio      - The GPIO pin to be used as i2c SCL
+ *      data_gpio     - The GPIO pin to be used as i2c SDA
  *
  * Return Value:
  *      -1   - Fail to initialize the i2c
  *       0   - Success
  */
-static long sm750le_i2c_init(unsigned char i2cClkGPIO,
-			      unsigned char i2cDataGPIO)
+static long sm750le_i2c_init(unsigned char clk_gpio,
+			     unsigned char data_gpio)
 {
 	int i;
 
@@ -357,14 +357,14 @@ static long sm750le_i2c_init(unsigned char i2cClkGPIO,
 	sw_i2c_clk_gpio_data_dir_reg = GPIO_DATA_DIRECTION_SM750LE;
 
 	/* Initialize the Clock GPIO Offset */
-	sw_i2c_clk_gpio = i2cClkGPIO;
+	sw_i2c_clk_gpio = clk_gpio;
 
 	/* Initialize the GPIO pin for the i2c Data Register */
 	sw_i2c_data_gpio_data_reg = GPIO_DATA_SM750LE;
 	sw_i2c_data_gpio_data_dir_reg = GPIO_DATA_DIRECTION_SM750LE;
 
 	/* Initialize the Data GPIO Offset */
-	sw_i2c_data_gpio = i2cDataGPIO;
+	sw_i2c_data_gpio = data_gpio;
 
 	/* Note that SM750LE don't have GPIO MUX and power is always on */
 
@@ -379,26 +379,26 @@ static long sm750le_i2c_init(unsigned char i2cClkGPIO,
  * This function initializes the i2c attributes and bus
  *
  * Parameters:
- *      i2cClkGPIO      - The GPIO pin to be used as i2c SCL
- *      i2cDataGPIO     - The GPIO pin to be used as i2c SDA
+ *      clk_gpio      - The GPIO pin to be used as i2c SCL
+ *      data_gpio     - The GPIO pin to be used as i2c SDA
  *
  * Return Value:
  *      -1   - Fail to initialize the i2c
  *       0   - Success
  */
 long sm750_sw_i2c_init(
-	unsigned char i2cClkGPIO,
-	unsigned char i2cDataGPIO
+	unsigned char clk_gpio,
+	unsigned char data_gpio
 )
 {
 	int i;
 
 	/* Return 0 if the GPIO pins to be used is out of range. The range is only from [0..63] */
-	if ((i2cClkGPIO > 31) || (i2cDataGPIO > 31))
+	if ((clk_gpio > 31) || (data_gpio > 31))
 		return -1;
 
 	if (getChipType() == SM750LE)
-		return sm750le_i2c_init(i2cClkGPIO, i2cDataGPIO);
+		return sm750le_i2c_init(clk_gpio, data_gpio);
 
 	/* Initialize the GPIO pin for the i2c Clock Register */
 	sw_i2c_clk_gpio_mux_reg = GPIO_MUX;
@@ -406,7 +406,7 @@ long sm750_sw_i2c_init(
 	sw_i2c_clk_gpio_data_dir_reg = GPIO_DATA_DIRECTION;
 
 	/* Initialize the Clock GPIO Offset */
-	sw_i2c_clk_gpio = i2cClkGPIO;
+	sw_i2c_clk_gpio = clk_gpio;
 
 	/* Initialize the GPIO pin for the i2c Data Register */
 	sw_i2c_data_gpio_mux_reg = GPIO_MUX;
@@ -414,7 +414,7 @@ long sm750_sw_i2c_init(
 	sw_i2c_data_gpio_data_dir_reg = GPIO_DATA_DIRECTION;
 
 	/* Initialize the Data GPIO Offset */
-	sw_i2c_data_gpio = i2cDataGPIO;
+	sw_i2c_data_gpio = data_gpio;
 
 	/* Enable the GPIO pins for the i2c Clock and Data (GPIO MUX) */
 	POKE32(sw_i2c_clk_gpio_mux_reg,
@@ -436,16 +436,16 @@ long sm750_sw_i2c_init(
  *  This function reads the slave device's register
  *
  *  Parameters:
- *      deviceAddress   - i2c Slave device address which register
+ *      addr   - i2c Slave device address which register
  *                        to be read from
- *      registerIndex   - Slave device's register to be read
+ *      reg    - Slave device's register to be read
  *
  *  Return Value:
  *      Register value
  */
 unsigned char sm750_sw_i2c_read_reg(
-	unsigned char deviceAddress,
-	unsigned char registerIndex
+	unsigned char addr,
+	unsigned char reg
 )
 {
 	unsigned char data;
@@ -454,14 +454,14 @@ unsigned char sm750_sw_i2c_read_reg(
 	sw_i2c_start();
 
 	/* Send the device address */
-	sw_i2c_write_byte(deviceAddress);
+	sw_i2c_write_byte(addr);
 
 	/* Send the register index */
-	sw_i2c_write_byte(registerIndex);
+	sw_i2c_write_byte(reg);
 
 	/* Get the bus again and get the data from the device read address */
 	sw_i2c_start();
-	sw_i2c_write_byte(deviceAddress + 1);
+	sw_i2c_write_byte(addr + 1);
 	data = sw_i2c_read_byte(1);
 
 	/* Stop swI2C and release the bus */
@@ -474,9 +474,9 @@ unsigned char sm750_sw_i2c_read_reg(
  *  This function writes a value to the slave device's register
  *
  *  Parameters:
- *      deviceAddress   - i2c Slave device address which register
+ *      addr            - i2c Slave device address which register
  *                        to be written
- *      registerIndex   - Slave device's register to be written
+ *      reg             - Slave device's register to be written
  *      data            - Data to be written to the register
  *
  *  Result:
@@ -484,12 +484,12 @@ unsigned char sm750_sw_i2c_read_reg(
  *         -1   - Fail
  */
 long sm750_sw_i2c_write_reg(
-	unsigned char deviceAddress,
-	unsigned char registerIndex,
+	unsigned char addr,
+	unsigned char reg,
 	unsigned char data
 )
 {
-	long returnValue = 0;
+	long ret = 0;
 
 	/* Send the Start signal */
 	sw_i2c_start();
@@ -497,14 +497,14 @@ long sm750_sw_i2c_write_reg(
 	/* Send the device address and read the data. All should return success
 	   in order for the writing processed to be successful
 	*/
-	if ((sw_i2c_write_byte(deviceAddress) != 0) ||
-	    (sw_i2c_write_byte(registerIndex) != 0) ||
+	if ((sw_i2c_write_byte(addr) != 0) ||
+	    (sw_i2c_write_byte(reg) != 0) ||
 	    (sw_i2c_write_byte(data) != 0)) {
-		returnValue = -1;
+		ret = -1;
 	}
 
 	/* Stop i2c and release the bus */
 	sw_i2c_stop();
 
-	return returnValue;
+	return ret;
 }
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.h b/drivers/staging/sm750fb/ddk750_swi2c.h
index 27a04f3a..b53629c 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.h
+++ b/drivers/staging/sm750fb/ddk750_swi2c.h
@@ -29,33 +29,33 @@
  *       0   - Success
  */
 long sm750_sw_i2c_init(
-	unsigned char i2cClkGPIO,
-	unsigned char i2cDataGPIO
+	unsigned char clk_gpio,
+	unsigned char data_gpio
 );
 
 /*
  *  This function reads the slave device's register
  *
  *  Parameters:
- *      deviceAddress   - i2c Slave device address which register
+ *      addr   - i2c Slave device address which register
  *                        to be read from
- *      registerIndex   - Slave device's register to be read
+ *      reg    - Slave device's register to be read
  *
  *  Return Value:
  *      Register value
  */
 unsigned char sm750_sw_i2c_read_reg(
-	unsigned char deviceAddress,
-	unsigned char registerIndex
+	unsigned char addr,
+	unsigned char reg
 );
 
 /*
  *  This function writes a value to the slave device's register
  *
  *  Parameters:
- *      deviceAddress   - i2c Slave device address which register
+ *      addr            - i2c Slave device address which register
  *                        to be written
- *      registerIndex   - Slave device's register to be written
+ *      reg             - Slave device's register to be written
  *      data            - Data to be written to the register
  *
  *  Result:
@@ -63,8 +63,8 @@ unsigned char sm750_sw_i2c_read_reg(
  *         -1   - Fail
  */
 long sm750_sw_i2c_write_reg(
-	unsigned char deviceAddress,
-	unsigned char registerIndex,
+	unsigned char addr,
+	unsigned char reg,
 	unsigned char data
 );
 
-- 
2.1.0


  parent reply	other threads:[~2015-09-06  6:21 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-06  6:17 [PATCH v3 00/17] staging: sm750fb: coding style fixes Mike Rapoport
2015-09-06  6:17 ` [PATCH v3 01/17] staging: sm750fb: rename hwI2CInit to sm750_hw_i2c_init Mike Rapoport
2015-09-09 18:39   ` Greg Kroah-Hartman
2015-09-06  6:17 ` [PATCH v3 02/17] staging: sm750fb: rename hwI2CClose to sm750_hw_i2c_close Mike Rapoport
2015-09-09 18:40   ` Greg Kroah-Hartman
2015-09-06  6:17 ` [PATCH v3 03/17] staging: sm750fb: rename hwI2CReadReg to sm750_hw_i2c_read_reg Mike Rapoport
2015-09-09 18:40   ` Greg Kroah-Hartman
2015-09-06  6:17 ` [PATCH v3 04/17] staging: sm750fb: rename hwI2CWriteReg to sm750_hw_i2c_write_reg Mike Rapoport
2015-09-06  6:17 ` [PATCH v3 05/17] staging: sm750fb: ddk750_hwi2c: rename CamelCase static functions Mike Rapoport
2015-09-06  6:17 ` [PATCH v3 06/17] staging: sm750fb: rename swI2CInit to sm750_sw_i2c_init Mike Rapoport
2015-09-09 18:41   ` Greg Kroah-Hartman
2015-09-09 20:03     ` Mike Rapoport
2015-09-09 20:07       ` Greg Kroah-Hartman
2015-09-10  4:40         ` Sudip Mukherjee
2015-09-10 12:39           ` Mike Rapoport
2015-09-10 13:01             ` Sudip Mukherjee
2015-09-12  2:51               ` Greg Kroah-Hartman
2015-09-06  6:17 ` [PATCH v3 07/17] staging: sm750fb: rename swI2CReadReg to sm750_sw_i2c_read_reg Mike Rapoport
2015-09-06  6:17 ` [PATCH v3 08/17] staging: sm750fb: rename swI2CWriteReg to sm750_sw_i2c_write_reg Mike Rapoport
2015-09-06  6:17 ` [PATCH v3 09/17] staging: sm750fb: ddk750_swi2c: staticize swI2C{SCL,SDA} Mike Rapoport
2015-09-06  6:18 ` [PATCH v3 10/17] staging: sm750fb: ddk750_swi2c: rename CamelCase static functions Mike Rapoport
2015-09-06  6:18 ` [PATCH v3 11/17] staging: sm750fb: ddk750_hw_i2c: rename busSpeedMode Mike Rapoport
2015-09-06  6:18 ` [PATCH v3 12/17] staging: sm750fb: hw_i2c_{read,write}: rename CamelCase variables Mike Rapoport
2015-09-06  6:18 ` [PATCH v3 13/17] staging: sm750fb: ddk750_hwi2c: reduce amount of CamelCase Mike Rapoport
2015-09-06  6:18 ` [PATCH v3 14/17] staging: sm750fb: ddk750_swi2c: rename CamelCase static variables Mike Rapoport
2015-09-06  6:18 ` Mike Rapoport [this message]
2015-09-06  6:18 ` [PATCH v3 16/17] staging: sm750fb: ddk750_*i2c: remove multiple blank lines Mike Rapoport
2015-09-06  6:18 ` [PATCH v3 17/17] staging: sm750fb: ddk750_*i2c: shorten lines to under 80 characters Mike Rapoport

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=1441520287-5232-16-git-send-email-mike.rapoport@gmail.com \
    --to=mike.rapoport@gmail.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sudip@vectorindia.org \
    --cc=sudipm.mukherjee@gmail.com \
    --cc=teddy.wang@siliconmotion.com \
    /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

Powered by JetHome