From: Dan Carpenter Date: Thu, 24 Dec 2015 07:23:03 +0000 (+0300) Subject: ACPI / debugger: remove some unneeded conditions X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=436db5ce0d0e892d2f7327dd7ffd573c5fb9e6cb;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ACPI / debugger: remove some unneeded conditions "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 Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/acpi/acpi_dbg.c b/drivers/acpi/acpi_dbg.c index fa18bd0162f4..975ccecf6215 100644 --- a/drivers/acpi/acpi_dbg.c +++ b/drivers/acpi/acpi_dbg.c @@ -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))