From patchwork Mon Sep 13 22:07:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 4328 Return-path: Envelope-to: mchehab@pedra Delivery-date: Mon, 13 Sep 2010 19:08:24 -0300 Received: from mchehab by pedra with local (Exim 4.72) (envelope-from ) id 1OvHCJ-000624-1b for mchehab@pedra; Mon, 13 Sep 2010 19:08:23 -0300 Received: from bombadil.infradead.org [18.85.46.34] by localhost.localdomain with IMAP (fetchmail-6.3.17) for (single-drop); Mon, 13 Sep 2010 19:08:23 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OvHBf-0003Fq-Ss; Mon, 13 Sep 2010 22:07:44 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752382Ab0IMWHR (ORCPT + 1 other); Mon, 13 Sep 2010 18:07:17 -0400 Received: from mail.perches.com ([173.55.12.10]:1966 "EHLO mail.perches.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752079Ab0IMWHQ (ORCPT ); Mon, 13 Sep 2010 18:07:16 -0400 Received: from [192.168.1.162] (unknown [192.168.1.162]) by mail.perches.com (Postfix) with ESMTP id 0DB0D24368; Mon, 13 Sep 2010 15:07:12 -0700 (PDT) Subject: [PATCH 07/25] drivers/media/video/zoran: Don't use initialized char array From: Joe Perches To: Mauro Carvalho Chehab Cc: linux-kernel@vger.kernel.org, mjpeg-users@lists.sourceforge.net, linux-media@vger.kernel.org In-Reply-To: <4C8E9C95.8070201@infradead.org> References: <6b7055a2e53510e8903828a53cad300a7d5bb912.1284406638.git.joe@perches.com> <4C8E9C95.8070201@infradead.org> Date: Mon, 13 Sep 2010 15:07:14 -0700 Message-ID: <1284415634.26719.103.camel@Joe-Laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Just fill the array as necessary and terminate with 0 Signed-off-by: Joe Perches --- -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/video/zoran/zoran_device.c b/drivers/media/video/zoran/zoran_device.c index 6f846ab..b02007e 100644 --- a/drivers/media/video/zoran/zoran_device.c +++ b/drivers/media/video/zoran/zoran_device.c @@ -1470,8 +1470,7 @@ zoran_irq (int irq, (zr->codec_mode == BUZ_MODE_MOTION_DECOMPRESS || zr->codec_mode == BUZ_MODE_MOTION_COMPRESS)) { if (zr36067_debug > 1 && (!zr->frame_num || zr->JPEG_error)) { - char sc[] = "0000"; - char sv[5]; + char sv[BUZ_NUM_STAT_COM + 1]; int i; printk(KERN_INFO @@ -1481,12 +1480,9 @@ zoran_irq (int irq, zr->jpg_settings.field_per_buff, zr->JPEG_missed); - strcpy(sv, sc); - for (i = 0; i < 4; i++) { - if (le32_to_cpu(zr->stat_com[i]) & 1) - sv[i] = '1'; - } - sv[4] = 0; + for (i = 0; i < BUZ_NUM_STAT_COM; i++) + sv[i] = le32_to_cpu(zr->stat_com[i]) & 1 ? '1' : '0'; + sv[BUZ_NUM_STAT_COM] = 0; printk(KERN_INFO "%s: stat_com=%s queue_state=%ld/%ld/%ld/%ld\n", ZR_DEVNAME(zr), sv,