* [PATCH v2] ata: ahci_xgene: Use int type for 'rc' to store error codes
@ 2025-08-26 7:54 Qianfeng Rong
2025-08-28 4:39 ` Damien Le Moal
0 siblings, 1 reply; 2+ messages in thread
From: Qianfeng Rong @ 2025-08-26 7:54 UTC (permalink / raw)
To: Damien Le Moal, Niklas Cassel, linux-ide, linux-kernel; +Cc: Qianfeng Rong
Use int instead of u32 for the 'rc' variable in xgene_ahci_softreset()
to store negative error codes returned by ahci_do_softreset().
In xgene_ahci_pmp_softreset(), remove the redundant 'rc' variable and
directly return the result of the ahci_do_softreset() call instead.
Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
---
v2: Remove redundant 'rc' in xgene_ahci_pmp_softreset().
---
drivers/ata/ahci_xgene.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
index 5d5a51a77f5d..6b8844646fcd 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);
}
/**
@@ -500,7 +497,7 @@ static int xgene_ahci_softreset(struct ata_link *link, unsigned int *class,
u32 port_fbs;
u32 port_fbs_save;
u32 retry = 1;
- u32 rc;
+ int rc;
port_fbs_save = readl(port_mmio + PORT_FBS);
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] ata: ahci_xgene: Use int type for 'rc' to store error codes
2025-08-26 7:54 [PATCH v2] ata: ahci_xgene: Use int type for 'rc' to store error codes Qianfeng Rong
@ 2025-08-28 4:39 ` Damien Le Moal
0 siblings, 0 replies; 2+ messages in thread
From: Damien Le Moal @ 2025-08-28 4:39 UTC (permalink / raw)
To: Qianfeng Rong, Niklas Cassel, linux-ide, linux-kernel
On 8/26/25 4:54 PM, Qianfeng Rong wrote:
> Use int instead of u32 for the 'rc' variable in xgene_ahci_softreset()
> to store negative error codes returned by ahci_do_softreset().
>
> In xgene_ahci_pmp_softreset(), remove the redundant 'rc' variable and
> directly return the result of the ahci_do_softreset() call instead.
>
> Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Applied to for-6.17-fixes. Thanks !
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-28 4:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-26 7:54 [PATCH v2] ata: ahci_xgene: Use int type for 'rc' to store error codes Qianfeng Rong
2025-08-28 4:39 ` Damien Le Moal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).