Skip to contentSkip to conversation

i2c-algo-bit: Cleanup bus_test calling convention

PATCH In review Jean Delvare 2 participants 3 messages Apr 15, 2011 2 messages not in the archive I2C subsystem host drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c-algo-bit: Cleanup bus_test calling convention

Now that we pass the i2c_adapter as the first parameter, it makes little sense to pass its name separately as the second.

---
Alex, I think it would make sense to merge this into your own patch?

 drivers/i2c/algos/i2c-algo-bit.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/i2c/algos/i2c-algo-bit.c +3 -2
@@ -232,9 +232,10 @@ static int i2c_inb(struct i2c_adapter *i
  * Sanity check for the adapter hardware - check the reaction of
  * the bus lines only if it seems to be idle.
  */
-static int test_bus(struct i2c_adapter *i2c_adap, char *name)
+static int test_bus(struct i2c_adapter *i2c_adap)
 {
 	struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
+	const char *name = i2c_adap->name;
 	int scl, sda, ret;
 
 	if (adap->pre_xfer) {
@@ -622,7 +623,7 @@ static int __i2c_bit_add_bus(struct i2c_
 	int ret;
 
 	if (bit_test) {
-		ret = test_bus(adap, adap->name);
+		ret = test_bus(adap);
 		if (ret < 0)
 			return -ENODEV;
 	}
Signature · 1 line
Jean Delvare

A message that is not in the archive (sent off-list or not yet received): [email protected]

Reviewed-by
#2 lore raw
Quoted 8 lines · Jean Delvare

Now that we pass the i2c_adapter as the first parameter, it makes little sense to pass its name separately as the second.

---
Alex, I think it would make sense to merge this into your own patch?

Yeah, looks good to me. Do you want to merge them or do you want me to send new patch?

Quoted 31 lines

 drivers/i2c/algos/i2c-algo-bit.c |    5 +++--

 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/i2c/algos/i2c-algo-bit.c   2011-04-15 11:05:09.000000000 +0200 renamed from drivers/i2c/algos/i2c-algo-bit.c      2011-04-15 10:47:39.000000000 +0200 +3 -3
@@ -232,9 +232,10 @@ static int i2c_inb(struct i2c_adapter *i
  * Sanity check for the adapter hardware - check the reaction of
  * the bus lines only if it seems to be idle.
  */
-static int test_bus(struct i2c_adapter *i2c_adap, char *name)
+static int test_bus(struct i2c_adapter *i2c_adap)
  {
        struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
+       const char *name = i2c_adap->name;
        int scl, sda, ret;
 
        if (adap->pre_xfer) {
@@ -622,7 +623,7 @@ static int __i2c_bit_add_bus(struct i2c_
        int ret;
 
        if (bit_test) {
-               ret = test_bus(adap, adap->name);
+               ret = test_bus(adap);
                if (ret < 0)
                        return -ENODEV;
        }
 
 
--

Jean Delvare

A message that is not in the archive (sent off-list or not yet received): BANLkTikBTN-3n0AUUxM2bgMKzME8zznycg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw
Quoted 4 lines · Alex Deucher
Quoted 3 lines · Jean Delvare

Now that we pass the i2c_adapter as the first parameter, it makes little sense to pass its name separately as the second.

Quoted 8 lines
Quoted 5 lines

---
Alex, I think it would make sense to merge this into your own patch?

Yeah, looks good to me. Do you want to merge them or do you want me to send new patch?

I'll take care, no problem.

Signature · 1 line
Jean Delvare