Skip to contentSkip to conversation

Reconsidering special return statements (with SmPL)?

cocci Markus Elfring 2 participants 3 messages Nov 17, 2024

lore
Share & tools
lore
#0 lore raw

Hello,

Another special statement combination was pointed out also by Nobuhiro Iwamatsu for further software development considerations.

[PATCH v2] power: reset: as3722-poweroff: Remove unnecessary return in as3722_poweroff_probe
https://lore.kernel.org/linux-kernel/[email protected]/

Would you like to become able to handle such source code places also by the means of the semantic patch language?

@display@
@@
*return ...;
*return ...;

Regards,
Markus

#1 lore raw
Quoted 9 lines · Markus Elfring

Hello,

Another special statement combination was pointed out also by Nobuhiro Iwamatsu for further software development considerations.

[PATCH v2] power: reset: as3722-poweroff: Remove unnecessary return in as3722_poweroff_probe
https://lore.kernel.org/linux-kernel/[email protected]/

Quoted 7 lines

Would you like to become able to handle such source code places also by the means of the semantic patch language?

@display@
@@
*return ...;
*return ...;

What is the problem here?

julia

#2 lore raw
Quoted 9 lines
Quoted 7 lines

Would you like to become able to handle such source code places also by the means of the semantic patch language?

@display@
@@
*return ...;
*return ...;

What is the problem here?

It seems that this source code search approach points known data processing challenges out (also according to a specific function implementation example).

https://elixir.bootlin.com/linux/v6.12-rc7/source/drivers/power/reset/as3722-poweroff.c#L55

How good does a desire for dead code avoidance fit to the current development status of computation tree logic variants?

Regards,
Markus