From 08df5d476fa817ff9c4a5a194a171e43f27a91c1 Mon Sep 17 00:00:00 2001 From: Michał Kępień Date: Fri, 16 Jun 2017 06:40:53 +0200 Subject: platform/x86: fujitsu-laptop: remove redundant safety checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do not check whether the pointer passed to ACPI add callbacks is NULL as it is earlier dereferenced anyway in the bus-level probe callback, acpi_device_probe(). Do not check the value of acpi_disabled in fujitsu_init(), because it is already done by acpi_bus_register_driver(), which is the first function called by fujitsu_init(). Signed-off-by: Michał Kępień Reviewed-by: Jonathan Woithe Signed-off-by: Darren Hart (VMware) --- drivers/platform/x86/fujitsu-laptop.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'drivers/platform/x86/fujitsu-laptop.c') diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index 1c6fdd952c75..04796b27a4f0 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -408,9 +408,6 @@ static int acpi_fujitsu_bl_add(struct acpi_device *device) if (acpi_video_get_backlight_type() != acpi_backlight_vendor) return -ENODEV; - if (!device) - return -EINVAL; - priv = devm_kzalloc(&device->dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; @@ -798,9 +795,6 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device) int error; int i; - if (!device) - return -EINVAL; - priv = devm_kzalloc(&device->dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; @@ -1019,9 +1013,6 @@ static int __init fujitsu_init(void) { int ret; - if (acpi_disabled) - return -ENODEV; - ret = acpi_bus_register_driver(&acpi_fujitsu_bl_driver); if (ret) return ret; -- cgit v1.2.3-59-g8ed1b