linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/8] [RESEND] cx231xx: Paranoic stack memory save
@ 2012-06-14 17:58 Peter Senna Tschudin
  2012-06-14 17:58 ` [PATCH 2/8] [RESEND] pvrusb2: Variables set but not used Peter Senna Tschudin
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Peter Senna Tschudin @ 2012-06-14 17:58 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Thomas Petazzoni, Devin Heitmueller,
	Julia Lawall, Greg Kroah-Hartman, linux-media
  Cc: Peter Senna Tschudin

Saves 255 bytes of stack memory on cx231xx_usb_probe() by removing a char array.

Tested by compilation only.

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
---
 drivers/media/video/cx231xx/cx231xx-cards.c |   17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/drivers/media/video/cx231xx/cx231xx-cards.c b/drivers/media/video/cx231xx/cx231xx-cards.c
index 8ed460d..02d4d36 100644
--- a/drivers/media/video/cx231xx/cx231xx-cards.c
+++ b/drivers/media/video/cx231xx/cx231xx-cards.c
@@ -1023,7 +1023,6 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
 	int nr = 0, ifnum;
 	int i, isoc_pipe = 0;
 	char *speed;
-	char descr[255] = "";
 	struct usb_interface_assoc_descriptor *assoc_desc;
 
 	udev = usb_get_dev(interface_to_usbdev(interface));
@@ -1098,20 +1097,10 @@ static int cx231xx_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));
-
-	cx231xx_info("New device %s@ %s Mbps "
+	cx231xx_info("New device %s %s @ %s Mbps "
 	     "(%04x:%04x) with %d interfaces\n",
-	     descr,
+	     udev->manufacturer ? udev->manufacturer : "",
+	     udev->product ? udev->product : "",
 	     speed,
 	     le16_to_cpu(udev->descriptor.idVendor),
 	     le16_to_cpu(udev->descriptor.idProduct),
-- 
1.7.10.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-06-15 13:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-14 17:58 [PATCH 1/8] [RESEND] cx231xx: Paranoic stack memory save Peter Senna Tschudin
2012-06-14 17:58 ` [PATCH 2/8] [RESEND] pvrusb2: Variables set but not used Peter Senna Tschudin
2012-06-14 17:58 ` [PATCH 3/8] [RESEND] saa7146: Variable " Peter Senna Tschudin
2012-06-15  6:02   ` Michael Hunold
2012-06-15  6:24     ` Hans Verkuil
2012-06-15  6:37       ` Michael Hunold
2012-06-14 17:58 ` [PATCH 4/8] [RESEND] saa7164: " Peter Senna Tschudin
2012-06-14 17:58 ` [PATCH 5/8] nuvoton-cir: Code cleanup: remove unused variable and function Peter Senna Tschudin
2012-06-14 19:02   ` Ben Hutchings
2012-06-15 13:26   ` Jarod Wilson
2012-06-14 17:58 ` [PATCH 6/8] stv0367: variable 'tps_rcvd' set but not used Peter Senna Tschudin
2012-06-14 17:58 ` [PATCH 7/8] stv090x: variable 'no_signal' " Peter Senna Tschudin
2012-06-14 17:58 ` [PATCH 8/8] s5h1420: Unused variable clock_setting Peter Senna Tschudin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).