Re: [PATCH v3 2/2] staging: rtl8723bs: refactor rtw_joinbss_event_prehandle to reduce indentation

From: Dan Carpenter

Date: Sat Mar 21 2026 - 03:47:16 EST


On Fri, Mar 20, 2026 at 04:47:17PM +0100, Jose A. Perez de Azpillaga wrote:
> -ignore_joinbss_callback:
> + spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
>
> spin_unlock_bh(&pmlmepriv->lock);
> + /* s5. Cancel assoc_timer */
> + timer_delete_sync(&pmlmepriv->assoc_timer);
> + return;
> }

So close... But you can't end a void function with a return statement.
It causes a checkpatch warning.

KTODO: Fix checkpatch to catch extra void statements

Checkpatch will catch an unnecessary return statement like this when
people use the -f option, but why can't it catch it for normal patches?
Surely, if there is a line which is just "}" then we could just print
a warning if the previous line is "return;"?

Test this on commits in the git log to find if there is a non-obvious
reason why it only works for -f.

regards,
dan carpenter