[PATCH 2/2] lp3971: remove redundant checking for count in lp3971_i2c_read()

Previous thread: [PATCH 1/2] lp3971: remove unnecessary ret value checking in lp3971_i2c_write() by Axel Lin on Wednesday, August 4, 2010 - 8:40 pm. (5 messages)

Next thread: linux-next: build failure after merge of the final tree (cifs tree related) by Stephen Rothwell on Wednesday, August 4, 2010 - 8:51 pm. (2 messages)
From: Axel Lin
Date: Wednesday, August 4, 2010 - 8:42 pm

We already check count value before calling i2c_smbus_read_byte_data(),
no need to check it again.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/regulator/lp3971.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/regulator/lp3971.c b/drivers/regulator/lp3971.c
index d4d9822..3bb82b6 100644
--- a/drivers/regulator/lp3971.c
+++ b/drivers/regulator/lp3971.c
@@ -377,7 +377,7 @@ static int lp3971_i2c_read(struct i2c_client *i2c, char reg, int count,
 	if (count != 1)
 		return -EIO;
 	ret = i2c_smbus_read_byte_data(i2c, reg);
-	if (ret < 0 || count != 1)
+	if (ret < 0)
 		return -EIO;
 
 	*dest = ret;
-- 
1.5.4.3



--

From: Mark Brown
Date: Thursday, August 5, 2010 - 5:12 am

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
--

Previous thread: [PATCH 1/2] lp3971: remove unnecessary ret value checking in lp3971_i2c_write() by Axel Lin on Wednesday, August 4, 2010 - 8:40 pm. (5 messages)

Next thread: linux-next: build failure after merge of the final tree (cifs tree related) by Stephen Rothwell on Wednesday, August 4, 2010 - 8:51 pm. (2 messages)