Fixing trivial warnings

Jonas Bonn jonas.bonn at gmail.com
Thu Oct 16 08:11:44 CEST 2008


> Some code was commented but now we need to comment two local
> variables to avoid warnings.
>

> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index 7cd7b27..6b363cb 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -153,7 +153,9 @@ static void i2c_device_shutdown(struct device *dev)
>
>  static int i2c_device_suspend(struct device * dev, pm_message_t mesg)
>  {
> +#if 0
>        struct i2c_driver *driver;
> +#endif
>
>        if (!dev->driver)
>                return 0;
> @@ -171,7 +173,9 @@ static int i2c_device_suspend(struct device * dev, pm_message_t mesg)
>
>  static int i2c_device_resume(struct device * dev)
>  {
> +#if 0
>        struct i2c_driver *driver;
> +#endif
>
>        if (!dev->driver)
>                return 0;
>

The problem, as I see it, with this is that this file is coming from
upstream.  The likely upstream fix will be to just delete these
variables, not to comment them out.  When a patch comes down with
these variables deleted then your patch won't apply as there will be
incompatible changes across the two.

The nice with using revision control is that you don't actually ever
DELETE anything... your old code is still available to you, even after
you've removed it from the source files.  And using a tool like gitk,
for example, makes it really easy to see what has changed.  Hence,
commenting stuff out if fine for your own scratch-work, but just
delete the line if you are going to push it out... if it doesn't work
it's just as easy to revert the patch as to remove the comments...

/Jonas



More information about the openmoko-kernel mailing list