Skip to contentSkip to conversation

lp3971: remove unnecessary ret value checking in lp3971_i2c_write()

PATCH Superseded Axel Lin 2 participants 5 messages Aug 5, 2010 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/2 lp3971: remove unnecessary ret value checking in lp3971_i2c_write()

i2c_smbus_write_byte_data() returns zero or negative value, therefore no need to check if ret is greater than zero or not.

---
 drivers/regulator/lp3971.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
drivers/regulator/lp3971.c +1 -7
index 8ae3732..d4d9822 100644
@@ -387,15 +387,9 @@ static int lp3971_i2c_read(struct i2c_client *i2c, char reg, int count,
 static int lp3971_i2c_write(struct i2c_client *i2c, char reg, int count,
 	const u16 *src)
 {
-	int ret;
-
 	if (count != 1)
 		return -EIO;
-	ret = i2c_smbus_write_byte_data(i2c, reg, *src);
-	if (ret >= 0)
-		return 0;
-
-	return ret;
+	return i2c_smbus_write_byte_data(i2c, reg, *src);
 }
 
 static u8 lp3971_reg_read(struct lp3971 *lp3971, u8 reg)
Signature · 1 line
1.5.4.3
Acked-by on v1 1/2
#1 lore raw
Quoted 4 lines · Axel Lin

i2c_smbus_write_byte_data() returns zero or negative value, therefore no need to check if ret is greater than zero or not.

but can I once more renew my request that you make some effort to provide subject lines for your patches which are consistent with the standard used for the area of the kernel you're submitting to?

author
#2 lore raw

hi Mark,

2010/8/5 Mark Brown <[email protected]>:

Quoted 12 lines · Axel Lin
Quoted 4 lines

i2c_smbus_write_byte_data() returns zero or negative value, therefore no need to check if ret is greater than zero or not.

but can I once more renew my request that you make some effort to provide subject lines for your patches which are consistent with the standard used for the area of the kernel you're submitting to?

I think we have communication problem.
I thought the subject "[PATCH 1/2] lp3971: remove unnecessary ret value checking in lp3971_i2c_write()"
is pretty clear.
Or do you mean something else?

Regards,
Axel

#3 lore raw
Quoted 11 lines · Axel Lin

2010/8/5 Mark Brown <[email protected]>:

Quoted 3 lines

but can I once more renew my request that you make some effort to provide subject lines for your patches which are consistent with the standard used for the area of the kernel you're submitting to?

I think we have communication problem.
I thought the subject "[PATCH 1/2] lp3971: remove unnecessary ret value checking in lp3971_i2c_write()"
is pretty clear.
Or do you mean something else?

In this case pretty much every regulator API patch has a subject line starting "regulator: " but none of your patches do this, you have created your own style which you use over all your patches.

author
#4 lore raw

2010/8/5 Mark Brown <[email protected]>:

Quoted 13 lines · Axel Lin
Quoted 11 lines

2010/8/5 Mark Brown <[email protected]>:

Quoted 3 lines

but can I once more renew my request that you make some effort to provide subject lines for your patches which are consistent with the standard used for the area of the kernel you're submitting to?

I think we have communication problem.
I thought the subject "[PATCH 1/2] lp3971: remove unnecessary ret value checking in lp3971_i2c_write()"
is pretty clear.
Or do you mean something else?

Quoted 4 lines

In this case pretty much every regulator API patch has a subject line starting "regulator: " but none of your patches do this, you have created your own style which you use over all your patches.

Got your point now. Will fix it next time.

Thanks,
Axel