[media] media: em28xx: Paranoic stack save
authorEzequiel García <elezegarcia@gmail.com>
Tue, 13 Mar 2012 13:27:09 +0000 (10:27 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 19 Mar 2012 22:14:22 +0000 (19:14 -0300)
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>
drivers/media/video/em28xx/em28xx-cards.c

index ce1b60f41dd8a1e99fd9b2593dd3ff8932df7a9a..d328616519e75700027df7dd36c1a6a3632e8602 100644 (file)
@@ -3122,7 +3122,6 @@ static int em28xx_usb_probe(struct usb_interface *interface,
        int i, nr;
        const int ifnum = interface->altsetting[0].desc.bInterfaceNumber;
        char *speed;
-       char descr[255] = "";
 
        udev = usb_get_dev(interface_to_usbdev(interface));
 
@@ -3227,21 +3226,11 @@ static int em28xx_usb_probe(struct usb_interface *interface,
                speed = "unknown";
        }
 
-       if (udev->manufacturer)
-               strlcpy(descr, udev->manufacturer, sizeof(descr));
-
-       if (udev->product) {
-               if (*descr)
-                       strlcat(descr, " ", sizeof(descr));
-               strlcat(descr, udev->product, sizeof(descr));
-       }
-
-       if (*descr)
-               strlcat(descr, " ", sizeof(descr));
-
        printk(KERN_INFO DRIVER_NAME
-               ": New device %s@ %s Mbps (%04x:%04x, interface %d, class %d)\n",
-               descr,
+               ": New device %s %s @ %s Mbps "
+               "(%04x:%04x, interface %d, class %d)\n",
+               udev->manufacturer ? udev->manufacturer : "",
+               udev->product ? udev->product : "",
                speed,
                le16_to_cpu(udev->descriptor.idVendor),
                le16_to_cpu(udev->descriptor.idProduct),