diff options
author | Ezequiel GarcĂa <elezegarcia@gmail.com> | 2012-03-13 09:27:09 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-03-19 18:14:22 -0400 |
commit | 401a582f869d64a4a5c3fb03926ffa54920a168d (patch) | |
tree | 1aaf686ba78f4d1b8dfa58bfc5048c1fceac1104 /drivers/media | |
parent | ef3d2dc366c8c32d58dbbf9898cfd4f853ff8fe0 (diff) |
[media] media: em28xx: Paranoic stack save
This patch saves 255 bytes of stack on usb_probe() by removing
a char array. In some platforms this is represents a substantial save.
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-cards.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index ce1b60f41dd8..d328616519e7 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
@@ -3122,7 +3122,6 @@ static int em28xx_usb_probe(struct usb_interface *interface, | |||
3122 | int i, nr; | 3122 | int i, nr; |
3123 | const int ifnum = interface->altsetting[0].desc.bInterfaceNumber; | 3123 | const int ifnum = interface->altsetting[0].desc.bInterfaceNumber; |
3124 | char *speed; | 3124 | char *speed; |
3125 | char descr[255] = ""; | ||
3126 | 3125 | ||
3127 | udev = usb_get_dev(interface_to_usbdev(interface)); | 3126 | udev = usb_get_dev(interface_to_usbdev(interface)); |
3128 | 3127 | ||
@@ -3227,21 +3226,11 @@ static int em28xx_usb_probe(struct usb_interface *interface, | |||
3227 | speed = "unknown"; | 3226 | speed = "unknown"; |
3228 | } | 3227 | } |
3229 | 3228 | ||
3230 | if (udev->manufacturer) | ||
3231 | strlcpy(descr, udev->manufacturer, sizeof(descr)); | ||
3232 | |||
3233 | if (udev->product) { | ||
3234 | if (*descr) | ||
3235 | strlcat(descr, " ", sizeof(descr)); | ||
3236 | strlcat(descr, udev->product, sizeof(descr)); | ||
3237 | } | ||
3238 | |||
3239 | if (*descr) | ||
3240 | strlcat(descr, " ", sizeof(descr)); | ||
3241 | |||
3242 | printk(KERN_INFO DRIVER_NAME | 3229 | printk(KERN_INFO DRIVER_NAME |
3243 | ": New device %s@ %s Mbps (%04x:%04x, interface %d, class %d)\n", | 3230 | ": New device %s %s @ %s Mbps " |
3244 | descr, | 3231 | "(%04x:%04x, interface %d, class %d)\n", |
3232 | udev->manufacturer ? udev->manufacturer : "", | ||
3233 | udev->product ? udev->product : "", | ||
3245 | speed, | 3234 | speed, |
3246 | le16_to_cpu(udev->descriptor.idVendor), | 3235 | le16_to_cpu(udev->descriptor.idVendor), |
3247 | le16_to_cpu(udev->descriptor.idProduct), | 3236 | le16_to_cpu(udev->descriptor.idProduct), |