linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: Drop dummy variable
@ 2010-06-16 14:41 Jean Delvare
       [not found] ` <20100616164147.43bf4fbe-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Jean Delvare @ 2010-06-16 14:41 UTC (permalink / raw)
  To: Linux I2C; +Cc: Justin P. Mattock, David Daney

Now that bus_for_each_drv() is no longer __must_check, we can drop the
dummy variable that was used to store the returned value.

Signed-off-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
Cc: Justin P. Mattock <justinmattock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
Anticipating that my other patch will be accepted...

 drivers/i2c/i2c-core.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- linux-2.6.35-rc3.orig/drivers/i2c/i2c-core.c	2010-06-16 12:44:52.000000000 +0200
+++ linux-2.6.35-rc3/drivers/i2c/i2c-core.c	2010-06-16 12:44:54.000000000 +0200
@@ -783,7 +783,7 @@ static int __process_new_adapter(struct
 
 static int i2c_register_adapter(struct i2c_adapter *adap)
 {
-	int res = 0, dummy;
+	int res = 0;
 
 	/* Can't register until after driver model init */
 	if (unlikely(WARN_ON(!i2c_bus_type.p))) {
@@ -821,8 +821,7 @@ static int i2c_register_adapter(struct i
 
 	/* Notify drivers */
 	mutex_lock(&core_lock);
-	dummy = bus_for_each_drv(&i2c_bus_type, NULL, adap,
-				 __process_new_adapter);
+	bus_for_each_drv(&i2c_bus_type, NULL, adap, __process_new_adapter);
 	mutex_unlock(&core_lock);
 
 	return 0;


-- 
Jean Delvare

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

* Re: [PATCH] i2c: Drop dummy variable
       [not found] ` <20100616164147.43bf4fbe-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
@ 2010-06-16 15:48   ` Justin P. Mattock
  0 siblings, 0 replies; 2+ messages in thread
From: Justin P. Mattock @ 2010-06-16 15:48 UTC (permalink / raw)
  To: Jean Delvare; +Cc: Linux I2C, David Daney

On 06/16/2010 07:41 AM, Jean Delvare wrote:
> Now that bus_for_each_drv() is no longer __must_check, we can drop the
> dummy variable that was used to store the returned value.
>
> Signed-off-by: Jean Delvare<khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
> Cc: Justin P. Mattock<justinmattock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> Anticipating that my other patch will be accepted...
>
>   drivers/i2c/i2c-core.c |    5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
>
> --- linux-2.6.35-rc3.orig/drivers/i2c/i2c-core.c	2010-06-16 12:44:52.000000000 +0200
> +++ linux-2.6.35-rc3/drivers/i2c/i2c-core.c	2010-06-16 12:44:54.000000000 +0200
> @@ -783,7 +783,7 @@ static int __process_new_adapter(struct
>
>   static int i2c_register_adapter(struct i2c_adapter *adap)
>   {
> -	int res = 0, dummy;
> +	int res = 0;
>
>   	/* Can't register until after driver model init */
>   	if (unlikely(WARN_ON(!i2c_bus_type.p))) {
> @@ -821,8 +821,7 @@ static int i2c_register_adapter(struct i
>
>   	/* Notify drivers */
>   	mutex_lock(&core_lock);
> -	dummy = bus_for_each_drv(&i2c_bus_type, NULL, adap,
> -				 __process_new_adapter);
> +	bus_for_each_drv(&i2c_bus_type, NULL, adap, __process_new_adapter);
>   	mutex_unlock(&core_lock);
>
>   	return 0;
>
>


cool thanks!! applied the above patch and now the warning is no longer 
there. Here is what I see:

   LD      kernel/built-in.o
   CC      drivers/i2c/i2c-core.o
   LD      drivers/i2c/built-in.o
   CC [M]  drivers/uio/uio.o

cheers,

Justin P. Mattock

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

end of thread, other threads:[~2010-06-16 15:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-16 14:41 [PATCH] i2c: Drop dummy variable Jean Delvare
     [not found] ` <20100616164147.43bf4fbe-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-06-16 15:48   ` Justin P. Mattock

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