lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <490CB545.90702@freemail.hu>
Date:	Sat, 01 Nov 2008 21:00:05 +0100
From:	Németh Márton <nm127@...email.hu>
To:	Hans Verkuil <hverkuil@...all.nl>
CC:	Robert William Fuller <hydrologiccycle@...il.com>,
	video4linux-list@...hat.com, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] video: simplify cx18_get_input() and ivtv_get_input()

From: Márton Németh <nm127@...email.hu>

The cx18_get_input() and ivtv_get_input() are called
once from the VIDIOC_ENUMINPUT ioctl() (see
drivers/media/video/v4l2-ioctl.c:1165) and once from
the *_log_status() functions. In the first case the
struct v4l2_input is already filled with zeros,
so doing this again is unnecessary.

The second case is only used for debugging purposes
from the VIDIOC_LOG_STATUS ioctl(). Currently only
the "name" field is used in the *_log_status() functions.

Signed-off-by: Márton Németh <nm127@...email.hu>
---
diff -upr linux-2.6.28-rc1.orig/drivers/media/video/cx18/cx18-cards.c linux-2.6.28-rc1/drivers/media/video/cx18/cx18-cards.c
--- linux-2.6.28-rc1.orig/drivers/media/video/cx18/cx18-cards.c	2008-11-01 20:27:58.000000000 +0100
+++ linux-2.6.28-rc1/drivers/media/video/cx18/cx18-cards.c	2008-11-01 20:36:39.000000000 +0100
@@ -419,10 +419,8 @@ int cx18_get_input(struct cx18 *cx, u16
 		"Composite 3"
 	};

-	memset(input, 0, sizeof(*input));
 	if (index >= cx->nof_inputs)
 		return -EINVAL;
-	input->index = index;
 	strlcpy(input->name, input_strs[card_input->video_type - 1],
 			sizeof(input->name));
 	input->type = (card_input->video_type == CX18_CARD_INPUT_VID_TUNER ?
diff -upr linux-2.6.28-rc1.orig/drivers/media/video/ivtv/ivtv-cards.c linux-2.6.28-rc1/drivers/media/video/ivtv/ivtv-cards.c
--- linux-2.6.28-rc1.orig/drivers/media/video/ivtv/ivtv-cards.c	2008-10-10 00:13:53.000000000 +0200
+++ linux-2.6.28-rc1/drivers/media/video/ivtv/ivtv-cards.c	2008-11-01 20:37:27.000000000 +0100
@@ -1199,10 +1199,8 @@ int ivtv_get_input(struct ivtv *itv, u16
 		"Composite 3"
 	};

-	memset(input, 0, sizeof(*input));
 	if (index >= itv->nof_inputs)
 		return -EINVAL;
-	input->index = index;
 	strlcpy(input->name, input_strs[card_input->video_type - 1],
 			sizeof(input->name));
 	input->type = (card_input->video_type == IVTV_CARD_INPUT_VID_TUNER ?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ