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]
Message-ID: <dd6e6054-3d7e-b43a-0386-71323c49ab27@opensource.wdc.com>
Date:   Thu, 23 Dec 2021 09:41:54 +0900
From:   Damien Le Moal <damien.lemoal@...nsource.wdc.com>
To:     Jiasheng Jiang <jiasheng@...as.ac.cn>, hdegoede@...hat.com,
        axboe@...nel.dk, p.zabel@...gutronix.de
Cc:     linux-ide@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ata: libahci_platform: Remove abundant check

On 12/22/21 16:24, Jiasheng Jiang wrote:
> It can be found that platform_get_irq() returns nagative code but not
> null when fails.
> The comment of the platform_get_irq clearly shows that.
> Therefore it should be better to remove the useless check.

Nope, platform_get_irq() can actually return 0 (the comment for that
function is wrong). So testing for !irq is valid and must be kept.

> 
> Fixes: fd990556f0fa ("ata: move library code from ahci_platform.c to libahci_platform.c")
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
> ---
>  drivers/ata/libahci_platform.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
> index b2f552088291..5ec68f138c28 100644
> --- a/drivers/ata/libahci_platform.c
> +++ b/drivers/ata/libahci_platform.c
> @@ -587,8 +587,6 @@ int ahci_platform_init_host(struct platform_device *pdev,
>  			dev_err(dev, "no irq\n");
>  		return irq;
>  	}
> -	if (!irq)
> -		return -EINVAL;
>  
>  	hpriv->irq = irq;
>  


-- 
Damien Le Moal
Western Digital Research

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ