staging: comedi: remove superfluous retval = 0 in comedi_read()
authorIan Abbott <abbotti@mev.co.uk>
Mon, 12 Oct 2015 16:21:26 +0000 (17:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Oct 2015 17:29:48 +0000 (10:29 -0700)
`comedi_read()` initializes `retval` to 0.  The other `retval = 0`
assignments are superfluous, so remove them.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/comedi_fops.c

index a979f621f9327257977b4f1cdde43b75ff60f520..88ba0b6488051840f81d85e62542f108207cee38 100644 (file)
@@ -2504,8 +2504,6 @@ static ssize_t comedi_read(struct file *file, char __user *buf, size_t nbytes,
                        if (!comedi_is_runflags_running(runflags)) {
                                if (comedi_is_runflags_in_error(runflags))
                                        retval = -EPIPE;
-                               else
-                                       retval = 0;
                                become_nonbusy = true;
                                break;
                        }
@@ -2519,7 +2517,6 @@ static ssize_t comedi_read(struct file *file, char __user *buf, size_t nbytes,
                                break;
                        }
                        if (!s->busy) {
-                               retval = 0;
                                break;
                        }
                        if (s->busy != file) {