[staging-next 1/1] staging/easycap: kill timeval members of easycap struct

Tomas Winkler tomas.winkler at intel.com
Mon Oct 10 06:36:38 UTC 2011


timeval[0-9] were not used or used in a ready only code
so we can remove them safely and so the code

Signed-off-by: Tomas Winkler <tomas.winkler at intel.com>
---
 drivers/staging/easycap/easycap.h       |   11 -------
 drivers/staging/easycap/easycap_ioctl.c |    2 -
 drivers/staging/easycap/easycap_main.c  |   48 -------------------------------
 drivers/staging/easycap/easycap_sound.c |    3 --
 4 files changed, 0 insertions(+), 64 deletions(-)

diff --git a/drivers/staging/easycap/easycap.h b/drivers/staging/easycap/easycap.h
index 22b24b6..7b256a9 100644
--- a/drivers/staging/easycap/easycap.h
+++ b/drivers/staging/easycap/easycap.h
@@ -324,13 +324,6 @@ struct easycap {
 	int lost[INPUT_MANY];
 	int merit[180];
 
-	struct timeval timeval0;
-	struct timeval timeval1;
-	struct timeval timeval2;
-	struct timeval timeval3;
-	struct timeval timeval6;
-	struct timeval timeval7;
-	struct timeval timeval8;
 	long long int dnbydt;
 
 	int    video_interface;
@@ -543,10 +536,6 @@ int              read_vt(struct usb_device *, u16);
 int              write_vt(struct usb_device *, u16, u16);
 int		isdongle(struct easycap *);
 /*---------------------------------------------------------------------------*/
-struct signed_div_result {
-	long long int quotient;
-	unsigned long long int remainder;
-} signed_div(long long int, long long int);
 
 
 /*---------------------------------------------------------------------------*/
diff --git a/drivers/staging/easycap/easycap_ioctl.c b/drivers/staging/easycap/easycap_ioctl.c
index 91262fb..c99addf 100644
--- a/drivers/staging/easycap/easycap_ioctl.c
+++ b/drivers/staging/easycap/easycap_ioctl.c
@@ -931,7 +931,6 @@ static int adjust_mute(struct easycap *peasycap, int value)
 			switch (peasycap->mute) {
 			case 1: {
 				peasycap->audio_idle = 1;
-				peasycap->timeval0.tv_sec = 0;
 				SAM("adjusting mute: %i=peasycap->audio_idle\n",
 				    peasycap->audio_idle);
 				return 0;
@@ -2333,7 +2332,6 @@ long easycap_unlocked_ioctl(struct file *file,
 
 		peasycap->video_idle = 1;
 		peasycap->audio_idle = 1;
-		peasycap->timeval0.tv_sec = 0;
 /*---------------------------------------------------------------------------*/
 /*
  *  IF THE WAIT QUEUES ARE NOT CLEARED IN RESPONSE TO THE STREAMOFF COMMAND
diff --git a/drivers/staging/easycap/easycap_main.c b/drivers/staging/easycap/easycap_main.c
index 3ea51c3..20ac194 100644
--- a/drivers/staging/easycap/easycap_main.c
+++ b/drivers/staging/easycap/easycap_main.c
@@ -270,7 +270,6 @@ static int reset(struct easycap *peasycap)
 
 	peasycap->video_eof = 0;
 	peasycap->audio_eof = 0;
-	do_gettimeofday(&peasycap->timeval7);
 /*---------------------------------------------------------------------------*/
 /*
  * RESTORE INPUT AND FORCE REFRESH OF STANDARD, FORMAT, ETC.
@@ -1215,10 +1214,6 @@ int easycap_dqbuf(struct easycap *peasycap, int mode)
 int
 field2frame(struct easycap *peasycap)
 {
-	struct timeval timeval;
-	long long int above, below;
-	u32 remainder;
-	struct signed_div_result sdr;
 
 	void *pex, *pad;
 	int kex, kad, mex, mad, rex, rad, rad2;
@@ -1576,52 +1571,11 @@ field2frame(struct easycap *peasycap)
 	if (peasycap->field_read == peasycap->field_fill)
 		SAM("WARNING: on exit, filling field buffer %i\n",
 						peasycap->field_read);
-/*---------------------------------------------------------------------------*/
-/*
- *  CALCULATE VIDEO STREAMING RATE
- */
-/*---------------------------------------------------------------------------*/
-	do_gettimeofday(&timeval);
-	if (peasycap->timeval6.tv_sec) {
-		below = ((long long int)(1000000)) *
-			((long long int)(timeval.tv_sec -
-						peasycap->timeval6.tv_sec)) +
-			 (long long int)(timeval.tv_usec - peasycap->timeval6.tv_usec);
-		above = (long long int)1000000;
-
-		sdr = signed_div(above, below);
-		above = sdr.quotient;
-		remainder = (u32)sdr.remainder;
-
-		JOM(8, "video streaming at %3lli.%03i fields per second\n",
-				above, (remainder/1000));
-	}
-	peasycap->timeval6 = timeval;
 
 	if (caches)
 		JOM(8, "%i=caches\n", caches);
 	return 0;
 }
-/*****************************************************************************/
-struct signed_div_result
-signed_div(long long int above, long long int below)
-{
-	struct signed_div_result sdr;
-
-	if (((0 <= above) && (0 <= below)) || ((0  > above) && (0  > below))) {
-		sdr.remainder = (unsigned long long int) do_div(above, below);
-		sdr.quotient  = (long long int) above;
-	} else {
-		if (0 > above)
-			above = -above;
-		if (0 > below)
-			below = -below;
-		sdr.remainder = (unsigned long long int) do_div(above, below);
-		sdr.quotient  = -((long long int) above);
-	}
-	return sdr;
-}
-/*****************************************************************************/
 /*---------------------------------------------------------------------------*/
 /*
  *  DECIMATION AND COLOURSPACE CONVERSION.
@@ -2755,8 +2709,6 @@ static void easycap_complete(struct urb *purb)
 							wake_up_interruptible
 								(&(peasycap->
 									 wq_video));
-							do_gettimeofday
-								(&peasycap->timeval7);
 						} else {
 						peasycap->video_junk++;
 						if (bad & 0x0010)
diff --git a/drivers/staging/easycap/easycap_sound.c b/drivers/staging/easycap/easycap_sound.c
index 213d040..b22bb39 100644
--- a/drivers/staging/easycap/easycap_sound.c
+++ b/drivers/staging/easycap/easycap_sound.c
@@ -666,9 +666,6 @@ easycap_sound_setup(struct easycap *peasycap)
 	peasycap->audio_eof = 0;
 	peasycap->audio_idle = 0;
 
-	peasycap->timeval1.tv_sec  = 0;
-	peasycap->timeval1.tv_usec = 0;
-
 	submit_audio_urbs(peasycap);
 
 	JOM(4, "finished initialization\n");
-- 
1.7.4.4

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.




More information about the devel mailing list