lkml.org 
[lkml]   [2024]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][next] tipc: remove redundant assignment to ret, simplify code
On Thu, Apr 11, 2024 at 10:04:10AM +0000, Tung Quang Nguyen wrote:
> >
> I suggest that err variable should be completely removed. Could you
> please also do the same thing for this code ?
> "
> ...
> err = skb_handler(skb, cb, tsk);
> if (err) {

If we write the code as:

if (some_function(parameters)) {

then at first that looks like a boolean. People probably think the
function returns true/false. But if we leave it as-is:

err = some_function(parameters);
if (err) {

Then that looks like error handling.

So it's better and more readable to leave it as-is.

regards,
dan carpenter

\
 
 \ /
  Last update: 2024-05-27 16:35    [W:0.060 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site