From: Markus Elfring Date: Tue, 29 Dec 2015 10:02:43 +0000 (-0200) Subject: [media] hdpvr: Refactoring for hdpvr_read() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b68554cd76bfed57a3aac2fc4ac4c60478d90050;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [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: Markus Elfring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c index 7dee22deebf3..ba7f02270c83 100644 --- a/drivers/media/usb/hdpvr/hdpvr-video.c +++ b/drivers/media/usb/hdpvr/hdpvr-video.c @@ -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, - buf->status == BUFSTAT_READY)) { - ret = -ERESTARTSYS; - goto err; - } + buf->status == BUFSTAT_READY)) + return -ERESTARTSYS; } if (buf->status != BUFSTAT_READY)