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

Commit b68554cd authored by Markus Elfring's avatar Markus Elfring Committed by Mauro Carvalho Chehab
Browse files

[media] hdpvr: Refactoring for hdpvr_read()



Let us return directly if the element "status" of the variable "buf"
indicates "BUFSTAT_READY".
A check repetition can be excluded for the variable "ret" at the end then.

Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 80c1bce9
Loading
Loading
Loading
Loading
+2 −4
Original line number Original line Diff line number Diff line
@@ -462,10 +462,8 @@ static ssize_t hdpvr_read(struct file *file, char __user *buffer, size_t count,
			}
			}


			if (wait_event_interruptible(dev->wait_data,
			if (wait_event_interruptible(dev->wait_data,
					      buf->status == BUFSTAT_READY)) {
					      buf->status == BUFSTAT_READY))
				ret = -ERESTARTSYS;
				return -ERESTARTSYS;
				goto err;
			}
		}
		}


		if (buf->status != BUFSTAT_READY)
		if (buf->status != BUFSTAT_READY)