public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] lp3971: remove unnecessary ret value checking in lp3971_i2c_write()
@ 2010-08-05  3:40 Axel Lin
  2010-08-05 12:11 ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Axel Lin @ 2010-08-05  3:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: Liam Girdwood, Mark Brown, Marek Szyprowski, Kyungmin Park

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

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

diff --git a/drivers/regulator/lp3971.c b/drivers/regulator/lp3971.c
index 8ae3732..d4d9822 100644
--- a/drivers/regulator/lp3971.c
+++ b/drivers/regulator/lp3971.c
@@ -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)
-- 
1.5.4.3




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] lp3971: remove unnecessary ret value checking in lp3971_i2c_write()
  2010-08-05  3:40 [PATCH 1/2] lp3971: remove unnecessary ret value checking in lp3971_i2c_write() Axel Lin
@ 2010-08-05 12:11 ` Mark Brown
  2010-08-05 14:22   ` Axel Lin
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2010-08-05 12:11 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Liam Girdwood, Marek Szyprowski, Kyungmin Park

On Thu, Aug 05, 2010 at 11:40:38AM +0800, Axel Lin wrote:
> i2c_smbus_write_byte_data() returns zero or negative value,
> therefore no need to check if ret is greater than zero or not.

> Signed-off-by: Axel Lin <axel.lin@gmail.com>

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

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?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] lp3971: remove unnecessary ret value checking in  lp3971_i2c_write()
  2010-08-05 12:11 ` Mark Brown
@ 2010-08-05 14:22   ` Axel Lin
  2010-08-05 14:43     ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Axel Lin @ 2010-08-05 14:22 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel, Liam Girdwood, Marek Szyprowski, Kyungmin Park

hi Mark,

2010/8/5 Mark Brown <broonie@opensource.wolfsonmicro.com>:
> On Thu, Aug 05, 2010 at 11:40:38AM +0800, Axel Lin wrote:
>> i2c_smbus_write_byte_data() returns zero or negative value,
>> therefore no need to check if ret is greater than zero or not.
>
>> Signed-off-by: Axel Lin <axel.lin@gmail.com>
>
> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
>
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] lp3971: remove unnecessary ret value checking in lp3971_i2c_write()
  2010-08-05 14:22   ` Axel Lin
@ 2010-08-05 14:43     ` Mark Brown
  2010-08-05 23:56       ` Axel Lin
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2010-08-05 14:43 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Liam Girdwood, Marek Szyprowski, Kyungmin Park

On Thu, Aug 05, 2010 at 10:22:13PM +0800, Axel Lin wrote:
> 2010/8/5 Mark Brown <broonie@opensource.wolfsonmicro.com>:

> > 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] lp3971: remove unnecessary ret value checking in  lp3971_i2c_write()
  2010-08-05 14:43     ` Mark Brown
@ 2010-08-05 23:56       ` Axel Lin
  0 siblings, 0 replies; 5+ messages in thread
From: Axel Lin @ 2010-08-05 23:56 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel, Liam Girdwood, Marek Szyprowski, Kyungmin Park

2010/8/5 Mark Brown <broonie@opensource.wolfsonmicro.com>:
> On Thu, Aug 05, 2010 at 10:22:13PM +0800, Axel Lin wrote:
>> 2010/8/5 Mark Brown <broonie@opensource.wolfsonmicro.com>:
>
>> > 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.
>

Got your point now. Will fix it next time.

Thanks,
Axel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-08-05 23:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-05  3:40 [PATCH 1/2] lp3971: remove unnecessary ret value checking in lp3971_i2c_write() Axel Lin
2010-08-05 12:11 ` Mark Brown
2010-08-05 14:22   ` Axel Lin
2010-08-05 14:43     ` Mark Brown
2010-08-05 23:56       ` Axel Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox