ACPI / debugger: remove some unneeded conditions
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 24 Dec 2015 07:23:03 +0000 (10:23 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 28 Dec 2015 00:29:40 +0000 (01:29 +0100)
"count" is unsigned so checking for less than zero here causes a static
checker warning.  And really it's better to let the access_ok() check
fail if the user passes in a NULL "buf" pointer because -EFAULT is the
correct error code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpi_dbg.c

index fa18bd0162f4795fb94d5b8fc81ceba4c2b13417..975ccecf6215b92533d477b915fcda1f54f4f8ba 100644 (file)
@@ -610,8 +610,6 @@ static ssize_t acpi_aml_read(struct file *file, char __user *buf,
        int ret = 0;
        int size = 0;
 
-       if (!buf || count < 0)
-               return -EINVAL;
        if (!count)
                return 0;
        if (!access_ok(VERIFY_WRITE, buf, count))
@@ -681,8 +679,6 @@ static ssize_t acpi_aml_write(struct file *file, const char __user *buf,
        int ret = 0;
        int size = 0;
 
-       if (!buf || count < 0)
-               return -EINVAL;
        if (!count)
                return 0;
        if (!access_ok(VERIFY_READ, buf, count))