Patchwork [-mm] i2c: style cleanups after idr_alloc() conversion

login
register
mail settings
Submitter Tejun Heo
Date Feb. 12, 2013, 5:34 p.m.
Message ID <20130212173414.GD7348@htj.dyndns.org>
Download mbox | patch
Permalink /patch/219921/
State Awaiting Upstream
Headers show

Comments

Tejun Heo - Feb. 12, 2013, 5:34 p.m.
Style cleanups suggested by Wolfram.

* s/res/id/ in i2c_add_numbered_adapter() so that it matches
  i2c_add_adapter().

* Add a blank line before return in i2c_add_numbered_adapter().

This patch is purely cosmetic.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Wolfram Sang <w.sang@pengutronix.de>
---
 drivers/i2c/i2c-core.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tejun Heo - Feb. 12, 2013, 5:36 p.m.
On Tue, Feb 12, 2013 at 09:34:14AM -0800, Tejun Heo wrote:
> Style cleanups suggested by Wolfram.
> 
> * s/res/id/ in i2c_add_numbered_adapter() so that it matches
>   i2c_add_adapter().
> 
> * Add a blank line before return in i2c_add_numbered_adapter().
> 
> This patch is purely cosmetic.
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: Wolfram Sang <w.sang@pengutronix.de>

JFYI, got a permanent delivery failure for w.sang@pengutronix.de.
Does anyone in i2c circle know other contact points?  If so, please
ping him about it.

Thanks!
Jean Delvare - Feb. 12, 2013, 6 p.m.
On Tue, 12 Feb 2013 09:36:48 -0800, Tejun Heo wrote:
> On Tue, Feb 12, 2013 at 09:34:14AM -0800, Tejun Heo wrote:
> > Style cleanups suggested by Wolfram.
> > 
> > * s/res/id/ in i2c_add_numbered_adapter() so that it matches
> >   i2c_add_adapter().
> > 
> > * Add a blank line before return in i2c_add_numbered_adapter().
> > 
> > This patch is purely cosmetic.
> > 
> > Signed-off-by: Tejun Heo <tj@kernel.org>
> > Cc: Wolfram Sang <w.sang@pengutronix.de>
> 
> JFYI, got a permanent delivery failure for w.sang@pengutronix.de.
> Does anyone in i2c circle know other contact points?  If so, please
> ping him about it.

See the updated Cc list :)
Wolfram Sang - Feb. 13, 2013, 8:42 p.m.
On Tue, Feb 12, 2013 at 09:34:14AM -0800, Tejun Heo wrote:
> Style cleanups suggested by Wolfram.
> 
> * s/res/id/ in i2c_add_numbered_adapter() so that it matches
>   i2c_add_adapter().
> 
> * Add a blank line before return in i2c_add_numbered_adapter().
> 
> This patch is purely cosmetic.
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>

Acked-by: Wolfram Sang <wolfram@the-dreams.de>

Would be nice to fold this patch into the previous one, if possible.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -935,16 +935,17 @@  out_list:
  */
 int i2c_add_adapter(struct i2c_adapter *adapter)
 {
-	int res;
+	int id;
 
 	mutex_lock(&core_lock);
-	res = idr_alloc(&i2c_adapter_idr, adapter,
-			__i2c_first_dynamic_bus_num, 0, GFP_KERNEL);
+	id = idr_alloc(&i2c_adapter_idr, adapter,
+		       __i2c_first_dynamic_bus_num, 0, GFP_KERNEL);
 	mutex_unlock(&core_lock);
-	if (res < 0)
-		return res;
+	if (id < 0)
+		return id;
+
+	adapter->nr = id;
 
-	adapter->nr = res;
 	return i2c_register_adapter(adapter);
 }
 EXPORT_SYMBOL(i2c_add_adapter);