lkml.org 
[lkml]   [2024]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3] ata: ahci_ceva: fix error handling for Xilinx GT PHY support
From
> > Platform clock and phy error resources are not cleaned up in Xilinx GT PHY
> > error path.
> >
> > To fix introduce the function ceva_ahci_platform_enable_resources()

> Applied:
> https://git.kernel.org/pub/scm/linux/kernel/git/libata/linux.git/log/?h=for-6.8-fixes

The error code “-EINVAL” was set before the statement “goto disable_resources”
multiple times in the adjusted implementation of the function “ceva_ahci_probe”.
I suggest to add a jump target so that a bit of exception handling
can be better reused at the end of this function.


How do you think about to apply the following script for the semantic
patch language (Coccinelle software) accordingly?


@replacement1@
identifier rc;
@@
<+...
if (...)
{
... when != rc
- rc = -EINVAL;
goto
- disable_resources
+ e_inval
;
}
...+>
return 0;
+
+e_inval:
+rc = -EINVAL;
disable_resources:
ahci_platform_disable_resources(hpriv);

@replacement2 disable neg_if, drop_else@
identifier replacement1.rc;
statement is;
@@
if (...)
is
else
{
... when != rc
- rc = -EINVAL;
goto
- disable_resources
+ e_inval
;
}


Regards,
Markus

\
 
 \ /
  Last update: 2024-05-27 15:10    [W:0.040 / U:1.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site