[PATCH 2/7] cache: andes_llcache: refactor initialization and cache operations
Krzysztof Kozlowski
krzk at kernel.org
Tue Mar 31 01:31:13 PDT 2026
On Mon, Mar 30, 2026 at 06:27:19PM +0800, Hui Min Mina Chou wrote:
> return 0;
> @@ -186,16 +181,18 @@ static const struct of_device_id andes_cache_ids[] = {
> static int __init andes_cache_init(void)
> {
> struct resource res;
> - int ret;
> + int ret = 0;
>
> struct device_node *np __free(device_node) =
> of_find_matching_node(NULL, andes_cache_ids);
> - if (!of_device_is_available(np))
> - return -ENODEV;
> + if (!of_device_is_available(np)) {
> + ret = -ENODEV;
> + goto err_ret;
> + }
You just made antipattern. Conor mentioned briefly that he does not see
commit as doing right, but let's clarify: this is absolutely wrong.
It is explicitly discouraged by cleanup.h, but even without that remarks
one simple 'return' in one line is converted to three lines with goto
and you call it "simpler"?
No way this is simpler. You made code worse.
Best regards,
Krzysztof
More information about the linux-riscv
mailing list