Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a991f44b authored by Trent Piepho's avatar Trent Piepho Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (6316): Change list_for_each+list_entry to list_for_each_entry



The rest of V4L files.

There is one list_for_each+list_entry in cpia_pp.c that
wasn't changed because it expects the loop iterator to remain NULL if
the list is empty.

A bug in vivi is fixed; the 'safe' version needs to be used because the loop
deletes the list entries.

Simplify a second loop in vivi and get rid if an un-used variable in that loop.

Signed-off-by: default avatarTrent Piepho <xyzzy@speakeasy.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent e77e2c2f
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -106,11 +106,9 @@ int bttv_sub_add_device(struct bttv_core *core, char *name)

int bttv_sub_del_devices(struct bttv_core *core)
{
	struct bttv_sub_device *sub;
	struct list_head *item,*save;
	struct bttv_sub_device *sub, *save;

	list_for_each_safe(item,save,&core->subs) {
		sub = list_entry(item,struct bttv_sub_device,list);
	list_for_each_entry_safe(sub, save, &core->subs, list) {
		list_del(&sub->list);
		device_unregister(&sub->dev);
	}
+1 −4
Original line number Diff line number Diff line
@@ -1100,7 +1100,6 @@ static int cx23885_restart_queue(struct cx23885_tsport *port,
{
	struct cx23885_dev *dev = port->dev;
	struct cx23885_buffer *buf;
	struct list_head *item;

	dprintk(5, "%s()\n", __FUNCTION__);
	if (list_empty(&q->active))
@@ -1148,10 +1147,8 @@ static int cx23885_restart_queue(struct cx23885_tsport *port,
	dprintk(2, "restart_queue [%p/%d]: restart dma\n",
		buf, buf->vb.i);
	cx23885_start_dma(port, q, buf);
	list_for_each(item, &q->active) {
		buf = list_entry(item, struct cx23885_buffer, vb.queue);
	list_for_each_entry(buf, &q->active, vb.queue)
		buf->count = q->count++;
	}
	mod_timer(&q->timeout, jiffies + BUFFER_TIMEOUT);
	return 0;
}
+1 −4
Original line number Diff line number Diff line
@@ -92,7 +92,6 @@ static int dpc_probe(struct saa7146_dev* dev)
{
	struct dpc* dpc = NULL;
	struct i2c_client *client;
	struct list_head *item;

	dpc = kzalloc(sizeof(struct dpc), GFP_KERNEL);
	if( NULL == dpc ) {
@@ -116,11 +115,9 @@ static int dpc_probe(struct saa7146_dev* dev)
	}

	/* loop through all i2c-devices on the bus and look who is there */
	list_for_each(item,&dpc->i2c_adapter.clients) {
		client = list_entry(item, struct i2c_client, list);
	list_for_each_entry(client, &dpc->i2c_adapter.clients, list)
		if( I2C_SAA7111A == client->addr )
			dpc->saa7111a = client;
	}

	/* check if all devices are present */
	if( 0 == dpc->saa7111a ) {
+1 −3
Original line number Diff line number Diff line
@@ -252,10 +252,8 @@ static int em28xx_v4l2_open(struct inode *inode, struct file *filp)
	int minor = iminor(inode);
	int errCode = 0;
	struct em28xx *h,*dev = NULL;
	struct list_head *list;

	list_for_each(list,&em28xx_devlist) {
		h = list_entry(list, struct em28xx, devlist);
	list_for_each_entry(h, &em28xx_devlist, devlist) {
		if (h->vdev->minor == minor) {
			dev  = h;
			dev->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+1 −3
Original line number Diff line number Diff line
@@ -153,7 +153,6 @@ static int mxb_probe(struct saa7146_dev* dev)
{
	struct mxb* mxb = NULL;
	struct i2c_client *client;
	struct list_head *item;
	int result;

	if ((result = request_module("saa7111")) < 0) {
@@ -196,8 +195,7 @@ static int mxb_probe(struct saa7146_dev* dev)
	}

	/* loop through all i2c-devices on the bus and look who is there */
	list_for_each(item,&mxb->i2c_adapter.clients) {
		client = list_entry(item, struct i2c_client, list);
	list_for_each_entry(client, &mxb->i2c_adapter.clients, list) {
		if( I2C_ADDR_TEA6420_1 == client->addr )
			mxb->tea6420_1 = client;
		if( I2C_ADDR_TEA6420_2 == client->addr )
Loading