lkml.org 
[lkml]   [2022]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/8] staging: r8188eu: don't set _SUCCESS again
On Sat, Apr 09, 2022 at 05:15:51PM +0200, Martin Kaiser wrote:
> ret is initialized to _SUCCESS, there's no need to set it again.
>
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>

I liked the original code better. Otherwise you wonder, is it
intentional to return success on this path. Smatch has a static
checker warning for these because most of the time it is a bug.
You can set "ret = _SUCCESS;" within 4 lines of the goto to silence
the warning. A second, not as good option, is to add comment
"/* deliberatly returning success */" which saves a little time, but
also wastes a little time.

If you have to remove something, then remove the initializer.

The compiler is probably clever enough to remove these assignments so
it doesn't make sense to add an additional way to annotate success
paths.

regards,
dan carpenter


\
 
 \ /
  Last update: 2022-04-11 12:21    [W:0.090 / U:1.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site