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] [day] [month] [year] [list]
Message-ID: <4779c117-c5b5-4344-848b-3e9d35028b67@vivo.com>
Date: Tue, 26 Aug 2025 14:58:20 +0800
From: Qianfeng Rong <rongqianfeng@...o.com>
To: Damien Le Moal <dlemoal@...nel.org>, Niklas Cassel <cassel@...nel.org>,
 linux-ide@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ata: ahci_xgene: Use int type for 'rc' to store error
 codes


在 2025/8/26 13:09, Damien Le Moal 写道:
> On 8/26/25 13:02, Qianfeng Rong wrote:
>> Use int instead of u32 for 'rc' variable to store negative error codes
>> returned by ahci_do_softreset().
>>
>> Signed-off-by: Qianfeng Rong <rongqianfeng@...o.com>
>> ---
>>   drivers/ata/ahci_xgene.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
>> index 5d5a51a77f5d..8d01c105fd44 100644
>> --- a/drivers/ata/ahci_xgene.c
>> +++ b/drivers/ata/ahci_xgene.c
>> @@ -450,7 +450,7 @@ static int xgene_ahci_pmp_softreset(struct ata_link *link, unsigned int *class,
>>   {
>>   	int pmp = sata_srst_pmp(link);
>>   	struct ata_port *ap = link->ap;
>> -	u32 rc;
>> +	int rc;
>>   	void __iomem *port_mmio = ahci_port_base(ap);
>>   	u32 port_fbs;
> If you fix this, please fix it properly: the rc variable is not needed at all in
> that function. You can just do:
>
> diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
> index 5d5a51a77f5d..a6d964f7184c 100644
> --- a/drivers/ata/ahci_xgene.c
> +++ b/drivers/ata/ahci_xgene.c
> @@ -450,7 +450,6 @@ static int xgene_ahci_pmp_softreset(struct ata_link *link,
> unsigned int *class,
>   {
>          int pmp = sata_srst_pmp(link);
>          struct ata_port *ap = link->ap;
> -       u32 rc;
>          void __iomem *port_mmio = ahci_port_base(ap);
>          u32 port_fbs;
>
> @@ -463,9 +462,7 @@ static int xgene_ahci_pmp_softreset(struct ata_link *link,
> unsigned int *class,
>          port_fbs |= pmp << PORT_FBS_DEV_OFFSET;
>          writel(port_fbs, port_mmio + PORT_FBS);
>
> -       rc = ahci_do_softreset(link, class, pmp, deadline, ahci_check_ready);
> -
> -       return rc;
> +       return ahci_do_softreset(link, class, pmp, deadline, ahci_check_ready);
>   }
The 'rc' variable in the first instance can indeed be removed, and I will
send the second version. Thanks.

Best regards,
Qianfeng
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ