2004-11-26 20:07:24

by Kei Tokunaga

[permalink] [raw]
Subject: [PATCH] fix unnecessary increment in firmware_class_hotplug()

This patch is to fix unnecessary increment of 'i' used to
specify an element of an arry 'envp[]' in firmware_class_hotplug().
The 'i' is already incremented in add_hotplug_env_var(), actually.

Thanks,
Keiichiro Tokunaga

Signed-off-by: Keiichiro Tokunaga <[email protected]>
Status: Compiled on 2.6.10-rc2-mm3
---

linux-2.6.10-rc2-mm3-kei/drivers/base/firmware_class.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/base/firmware_class.c~fix_firmware_class_hotplug drivers/base/firmware_class.c
--- linux-2.6.10-rc2-mm3/drivers/base/firmware_class.c~fix_firmware_class_hotplug 2004-11-25 18:31:19.278701104 +0900
+++ linux-2.6.10-rc2-mm3-kei/drivers/base/firmware_class.c 2004-11-25 18:31:37.555922544 +0900
@@ -103,7 +103,7 @@ firmware_class_hotplug(struct class_devi
"FIRMWARE=%s", fw_priv->fw_id))
return -ENOMEM;

- envp[i++] = NULL;
+ envp[i] = NULL;

return 0;
}

_


2004-11-26 20:54:16

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH] fix unnecessary increment in firmware_class_hotplug()

Hi Keiichiro,

> This patch is to fix unnecessary increment of 'i' used to
> specify an element of an arry 'envp[]' in firmware_class_hotplug().
> The 'i' is already incremented in add_hotplug_env_var(), actually.

you are right. The incrementation is wrong, but it doesn't have any
negative effect. However the same applies for the usb_hotplug() function
in drivers/usb/core/usb.c.

> Signed-off-by: Keiichiro Tokunaga <[email protected]>

Signed-off-by: Marcel Holtmann <[email protected]>

Regards

Marcel


Attachments:
patch (596.00 B)

2004-11-29 19:35:19

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] fix unnecessary increment in firmware_class_hotplug()

On Fri, Nov 26, 2004 at 09:30:24PM +0100, Marcel Holtmann wrote:
> Hi Keiichiro,
>
> > This patch is to fix unnecessary increment of 'i' used to
> > specify an element of an arry 'envp[]' in firmware_class_hotplug().
> > The 'i' is already incremented in add_hotplug_env_var(), actually.
>
> you are right. The incrementation is wrong, but it doesn't have any
> negative effect. However the same applies for the usb_hotplug() function
> in drivers/usb/core/usb.c.
>
> > Signed-off-by: Keiichiro Tokunaga <[email protected]>
>
> Signed-off-by: Marcel Holtmann <[email protected]>

Applied, thanks.

greg k-h