[linux-dvb] [patch 2.6.12-rc4-dvb-cvs 12/14] dvb: more local variables in dvb_dmxdev_init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add a few local variables in dvb_dmxdev_init

No functional change.

Signed-off-by: Francois Romieu <romieu@xxxxxxxxxxxxx>

diff -puN drivers/media/dvb/dvb-core/dmxdev.c~dvb-230 drivers/media/dvb/dvb-core/dmxdev.c
--- a/drivers/media/dvb/dvb-core/dmxdev.c~dvb-230	2005-05-20 19:39:45.948683357 +0200
+++ b/drivers/media/dvb/dvb-core/dmxdev.c	2005-05-20 19:39:45.951682868 +0200
@@ -1085,16 +1085,18 @@ static struct dvb_device dvbdev_dvr = {
 int
 dvb_dmxdev_init(struct dmxdev *dmxdev, struct dvb_adapter *dvb_adapter)
 {
+	const int filternum = dmxdev->filternum;
+	struct dmx_demux *dmx = &dmxdev->demux;
 	int i;
 
-	if (dmxdev->demux->open(dmxdev->demux) < 0)
+	if (dmx->open(dmx) < 0)
 		return -EUSERS;
 
-	dmxdev->filter = vmalloc(dmxdev->filternum*sizeof(struct dmxdev_filter));
+	dmxdev->filter = vmalloc(filternum*sizeof(struct dmxdev_filter));
 	if (!dmxdev->filter)
 		return -ENOMEM;
 
-	dmxdev->dvr = vmalloc(dmxdev->filternum*sizeof(struct dmxdev_dvr));
+	dmxdev->dvr = vmalloc(filternum*sizeof(struct dmxdev_dvr));
 	if (!dmxdev->dvr) {
 		vfree(dmxdev->filter);
 		dmxdev->filter = NULL;
@@ -1103,14 +1105,17 @@ dvb_dmxdev_init(struct dmxdev *dmxdev, s
 
 	sema_init(&dmxdev->mutex, 1);
 	spin_lock_init(&dmxdev->lock);
-	for (i=0; i<dmxdev->filternum; i++) {
-		dmxdev->filter[i].dev=dmxdev;
-		dmxdev->filter[i].buffer.data=NULL;
-		dvb_dmxdev_filter_state_set(&dmxdev->filter[i], DMXDEV_STATE_FREE);
-		dmxdev->dvr[i].dev=dmxdev;
-		dmxdev->dvr[i].buffer.data=NULL;
-		dvb_dmxdev_filter_state_set(&dmxdev->filter[i], DMXDEV_STATE_FREE);
-		dvb_dmxdev_dvr_state_set(&dmxdev->dvr[i], DMXDEV_STATE_FREE);
+	for (i = 0; i < filternum; i++) {
+		struct dmxdev_filter *filter = dmxdev->filter + i;
+		struct dmxdev_dvr *dvr = dmxdev->dvr + i;
+
+		filter->dev = dmxdev;
+		filter->buffer.data = NULL;
+		dvb_dmxdev_filter_state_set(filter, DMXDEV_STATE_FREE);
+
+		dvr->dev = dmxdev;
+		dvr->buffer.data = NULL;
+		dvb_dmxdev_dvr_state_set(dvr, DMXDEV_STATE_FREE);
 	}
 
 	dvb_register_device(dvb_adapter, &dmxdev->dvbdev, &dvbdev_demux, dmxdev, DVB_DEVICE_DEMUX);

_



[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux