lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 18 Apr 2022 09:02:44 +0200
From:   Alexander Sverdlin <alexander.sverdlin@...il.com>
To:     cgel.zte@...il.com, dmitry.torokhov@...il.com
Cc:     lv.ruyi@....com.cn, linux-input@...r.kernel.org,
        linux-kernel@...r.kernel.org, Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH] input: Make use of the helper function
 devm_platform_ioremap_resource()

Hello Lv!

On Mon, 2022-04-18 at 01:50 +0000, cgel.zte@...il.com wrote:
> From: Lv Ruyi <lv.ruyi@....com.cn>
> 
> Use the devm_platform_ioremap_resource() helper instead of calling
> platform_get_resource() and devm_ioremap_resource() separately.Make the
> code simpler without functional changes.
> 
> Reported-by: Zeal Robot <zealci@....com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@....com.cn>

Acked-by: Alexander Sverdlin <alexander.sverdlin@...il.com>

> ---
>  drivers/input/keyboard/ep93xx_keypad.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c
> index 272a4f1c6e81..7a3b0664ab4f 100644
> --- a/drivers/input/keyboard/ep93xx_keypad.c
> +++ b/drivers/input/keyboard/ep93xx_keypad.c
> @@ -231,7 +231,6 @@ static int ep93xx_keypad_probe(struct platform_device *pdev)
>         struct ep93xx_keypad *keypad;
>         const struct matrix_keymap_data *keymap_data;
>         struct input_dev *input_dev;
> -       struct resource *res;
>         int err;
>  
>         keypad = devm_kzalloc(&pdev->dev, sizeof(*keypad), GFP_KERNEL);
> @@ -250,11 +249,7 @@ static int ep93xx_keypad_probe(struct platform_device *pdev)
>         if (keypad->irq < 0)
>                 return keypad->irq;
>  
> -       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       if (!res)
> -               return -ENXIO;
> -
> -       keypad->mmio_base = devm_ioremap_resource(&pdev->dev, res);
> +       keypad->mmio_base = devm_platform_ioremap_resource(pdev, 0);
>         if (IS_ERR(keypad->mmio_base))
>                 return PTR_ERR(keypad->mmio_base);
>  

-- 
Alexander Sverdlin.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ