Thread (42 messages) 42 messages, 13 authors, 2025-03-13

Re: [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2025-02-21 19:37:09
Also in: linux-arch, linux-crypto, linux-gpio, linux-iommu, linux-mm, linux-pm, linux-rdma, linux-wireless, lkml

On Fri, 2025-02-21 at 11:00 -0800, Stephen Hemminger wrote:
Is this something that could be done with a coccinelle script?
Almost enough to do this:

@@
identifier fn;
expression E;
@@
void fn(...)
{
...
-return
E;
}


It takes a long time to run though, and does some wrong things as well:
if the return is in the middle of the function, it still matches and
removes it erroneously.

johannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help