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:   Wed, 26 Aug 2020 21:57:43 +0200
From:   Hans de Goede <hdegoede@...hat.com>
To:     Krzysztof Kozlowski <krzk@...nel.org>,
        Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Bastien Nocera <hadess@...ess.net>,
        Sangwon Jee <jeesw@...fas.com>,
        Eugen Hristev <eugen.hristev@...rochip.com>,
        "Gustavo A. R. Silva" <gustavoars@...nel.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
        platform-driver-x86@...r.kernel.org
Subject: Re: [PATCH 01/24] Input: bcm-keypad - Simplify with dev_err_probe()

Hi,

As someone who has added the if (error != -EPROBE_DEFER) dev_err()
pattern in way too many places myself, I'm quite happy to see this
new (I presume?) helper and this nice cleanup series.

The entire series looks good to me, and you can add my:

Reviewed-by: Hans de Goede <hdegoede@...hat.com>

To the entire series.

Regards,

Hans



On 8/26/20 8:16 PM, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe().  Less code and also it prints the error value.
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@...nel.org>
> ---
>   drivers/input/keyboard/bcm-keypad.c | 8 +++-----
>   1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/input/keyboard/bcm-keypad.c b/drivers/input/keyboard/bcm-keypad.c
> index 2b771c3a5578..1bf71e7c9e0d 100644
> --- a/drivers/input/keyboard/bcm-keypad.c
> +++ b/drivers/input/keyboard/bcm-keypad.c
> @@ -379,11 +379,9 @@ static int bcm_kp_probe(struct platform_device *pdev)
>   	kp->clk = devm_clk_get(&pdev->dev, "peri_clk");
>   	if (IS_ERR(kp->clk)) {
>   		error = PTR_ERR(kp->clk);
> -		if (error != -ENOENT) {
> -			if (error != -EPROBE_DEFER)
> -				dev_err(&pdev->dev, "Failed to get clock\n");
> -			return error;
> -		}
> +		if (error != -ENOENT)
> +			return dev_err_probe(&pdev->dev, error, "Failed to get clock\n");
> +
>   		dev_dbg(&pdev->dev,
>   			"No clock specified. Assuming it's enabled\n");
>   		kp->clk = NULL;
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ