lkml.org 
[lkml]   [2017]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 2/7] platform/x86: fujitsu-laptop: remove redundant safety checks
    Date
    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ń <kernel@kempniu.pl>
    ---
    drivers/platform/x86/fujitsu-laptop.c | 9 ---------
    1 file changed, 9 deletions(-)

    diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
    index 54cb7ae541d4..c64d5305ff37 100644
    --- a/drivers/platform/x86/fujitsu-laptop.c
    +++ b/drivers/platform/x86/fujitsu-laptop.c
    @@ -406,9 +406,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;
    @@ -796,9 +793,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;
    @@ -993,9 +987,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;
    --
    2.13.1
    \
     
     \ /
      Last update: 2017-06-16 06:42    [W:5.324 / U:0.472 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site