Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

[PATCH] do not overwrite the first part of phys string

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


nm127 at freemail

Nov 20, 2009, 11:55 PM

Post #1 of 3 (132 views)
Permalink
[PATCH] do not overwrite the first part of phys string

From: Márton Németh <nm127 [at] freemail>

Use strlcat() to append a string to the previously created first part.

Signed-off-by: Márton Németh <nm127 [at] freemail>
---
diff -upr linux-2.6.32-rc7.orig/drivers/hid/usbhid/usbkbd.c linux-2.6.32-rc7/drivers/hid/usbhid/usbkbd.c
--- linux-2.6.32-rc7.orig/drivers/hid/usbhid/usbkbd.c 2009-09-10 00:13:59.000000000 +0200
+++ linux-2.6.32-rc7/drivers/hid/usbhid/usbkbd.c 2009-11-21 08:48:32.000000000 +0100
@@ -266,7 +266,7 @@ static int usb_kbd_probe(struct usb_inte
le16_to_cpu(dev->descriptor.idProduct));

usb_make_path(dev, kbd->phys, sizeof(kbd->phys));
- strlcpy(kbd->phys, "/input0", sizeof(kbd->phys));
+ strlcat(kbd->phys, "/input0", sizeof(kbd->phys));

input_dev->name = kbd->name;
input_dev->phys = kbd->phys;
diff -upr linux-2.6.32-rc7.orig/drivers/input/misc/ati_remote.c linux-2.6.32-rc7/drivers/input/misc/ati_remote.c
--- linux-2.6.32-rc7.orig/drivers/input/misc/ati_remote.c 2009-09-10 00:13:59.000000000 +0200
+++ linux-2.6.32-rc7/drivers/input/misc/ati_remote.c 2009-11-21 08:48:50.000000000 +0100
@@ -766,7 +766,7 @@ static int ati_remote_probe(struct usb_i
ati_remote->interface = interface;

usb_make_path(udev, ati_remote->phys, sizeof(ati_remote->phys));
- strlcpy(ati_remote->phys, "/input0", sizeof(ati_remote->phys));
+ strlcat(ati_remote->phys, "/input0", sizeof(ati_remote->phys));

if (udev->manufacturer)
strlcpy(ati_remote->name, udev->manufacturer, sizeof(ati_remote->name));
diff -upr linux-2.6.32-rc7.orig/drivers/input/misc/powermate.c linux-2.6.32-rc7/drivers/input/misc/powermate.c
--- linux-2.6.32-rc7.orig/drivers/input/misc/powermate.c 2009-09-10 00:13:59.000000000 +0200
+++ linux-2.6.32-rc7/drivers/input/misc/powermate.c 2009-11-21 08:48:44.000000000 +0100
@@ -338,7 +338,7 @@ static int powermate_probe(struct usb_in
pm->input = input_dev;

usb_make_path(udev, pm->phys, sizeof(pm->phys));
- strlcpy(pm->phys, "/input0", sizeof(pm->phys));
+ strlcat(pm->phys, "/input0", sizeof(pm->phys));

spin_lock_init(&pm->lock);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


dmitry.torokhov at gmail

Nov 23, 2009, 8:08 AM

Post #2 of 3 (122 views)
Permalink
Re: [PATCH] do not overwrite the first part of phys string [In reply to]

Jiri,

Do you want to split out usbkbd section or do you want me to pick up
everything?

Thanks.

On Sat, Nov 21, 2009 at 08:55:12AM +0100, Németh Márton wrote:
> From: Márton Németh <nm127 [at] freemail>
>
> Use strlcat() to append a string to the previously created first part.
>
> Signed-off-by: Márton Németh <nm127 [at] freemail>
> ---
> diff -upr linux-2.6.32-rc7.orig/drivers/hid/usbhid/usbkbd.c linux-2.6.32-rc7/drivers/hid/usbhid/usbkbd.c
> --- linux-2.6.32-rc7.orig/drivers/hid/usbhid/usbkbd.c 2009-09-10 00:13:59.000000000 +0200
> +++ linux-2.6.32-rc7/drivers/hid/usbhid/usbkbd.c 2009-11-21 08:48:32.000000000 +0100
> @@ -266,7 +266,7 @@ static int usb_kbd_probe(struct usb_inte
> le16_to_cpu(dev->descriptor.idProduct));
>
> usb_make_path(dev, kbd->phys, sizeof(kbd->phys));
> - strlcpy(kbd->phys, "/input0", sizeof(kbd->phys));
> + strlcat(kbd->phys, "/input0", sizeof(kbd->phys));
>
> input_dev->name = kbd->name;
> input_dev->phys = kbd->phys;
> diff -upr linux-2.6.32-rc7.orig/drivers/input/misc/ati_remote.c linux-2.6.32-rc7/drivers/input/misc/ati_remote.c
> --- linux-2.6.32-rc7.orig/drivers/input/misc/ati_remote.c 2009-09-10 00:13:59.000000000 +0200
> +++ linux-2.6.32-rc7/drivers/input/misc/ati_remote.c 2009-11-21 08:48:50.000000000 +0100
> @@ -766,7 +766,7 @@ static int ati_remote_probe(struct usb_i
> ati_remote->interface = interface;
>
> usb_make_path(udev, ati_remote->phys, sizeof(ati_remote->phys));
> - strlcpy(ati_remote->phys, "/input0", sizeof(ati_remote->phys));
> + strlcat(ati_remote->phys, "/input0", sizeof(ati_remote->phys));
>
> if (udev->manufacturer)
> strlcpy(ati_remote->name, udev->manufacturer, sizeof(ati_remote->name));
> diff -upr linux-2.6.32-rc7.orig/drivers/input/misc/powermate.c linux-2.6.32-rc7/drivers/input/misc/powermate.c
> --- linux-2.6.32-rc7.orig/drivers/input/misc/powermate.c 2009-09-10 00:13:59.000000000 +0200
> +++ linux-2.6.32-rc7/drivers/input/misc/powermate.c 2009-11-21 08:48:44.000000000 +0100
> @@ -338,7 +338,7 @@ static int powermate_probe(struct usb_in
> pm->input = input_dev;
>
> usb_make_path(udev, pm->phys, sizeof(pm->phys));
> - strlcpy(pm->phys, "/input0", sizeof(pm->phys));
> + strlcat(pm->phys, "/input0", sizeof(pm->phys));
>
> spin_lock_init(&pm->lock);
>

--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


jkosina at suse

Nov 23, 2009, 8:11 AM

Post #3 of 3 (123 views)
Permalink
Re: [PATCH] do not overwrite the first part of phys string [In reply to]

On Mon, 23 Nov 2009, Dmitry Torokhov wrote:

> Do you want to split out usbkbd section or do you want me to pick up
> everything?

Please go ahead with everything.

Acked-by: Jiri Kosina <jkosina [at] suse>

for that part, FWIW.

Thanks,

--
Jiri Kosina
SUSE Labs, Novell Inc.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.