linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org
Cc: Mark Brown
	<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH -mm] i2c: style cleanups after idr_alloc() conversion
Date: Tue, 12 Feb 2013 09:34:14 -0800	[thread overview]
Message-ID: <20130212173414.GD7348@htj.dyndns.org> (raw)
In-Reply-To: <20130210114729.GB5472-8EAEigeeuNG034pCzgS/Qg7AFbiQbgqx@public.gmane.org>

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-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
 drivers/i2c/i2c-core.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

--- 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);

  parent reply	other threads:[~2013-02-12 17:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1360179649-22465-1-git-send-email-tj@kernel.org>
     [not found] ` <1360179649-22465-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2013-02-06 19:40   ` [PATCH 37/77] i2c: convert to idr_alloc() Tejun Heo
2013-02-07 15:28     ` Mark Brown
     [not found]       ` <20130207152831.GA14797-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-02-07 16:32         ` Tejun Heo
     [not found]           ` <20130207163247.GL2875-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-02-07 16:39             ` Mark Brown
     [not found]               ` <20130207163958.GY4720-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2013-02-07 16:55                 ` [PATCH v2] " Tejun Heo
2013-02-07 18:52                   ` Mark Brown
     [not found]                   ` <20130207165547.GO2875-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-02-08 12:10                     ` Mark Brown
2013-02-10 11:47                     ` Wolfram Sang
     [not found]                       ` <20130210114729.GB5472-8EAEigeeuNG034pCzgS/Qg7AFbiQbgqx@public.gmane.org>
2013-02-12 17:34                         ` Tejun Heo [this message]
     [not found]                           ` <20130212173414.GD7348-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-02-12 17:36                             ` [PATCH -mm] i2c: style cleanups after idr_alloc() conversion Tejun Heo
     [not found]                               ` <20130212173648.GE7348-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-02-12 18:00                                 ` Jean Delvare
2013-02-13 20:42                             ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130212173414.GD7348@htj.dyndns.org \
    --to=tj-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
    --cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).