lkml.org 
[lkml]   [2023]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next v4 1/2] netconsole: Create a allocation helper
On Fri,  4 Aug 2023 05:43:20 -0700 Breno Leitao wrote:
> + struct netconsole_target *nt = alloc_and_init();
> + int err = -ENOMEM;
> +
> + if (!nt)
> + goto fail;

No complex code in the variable init, please.
Makes the code harder to read.

struct netconsole_target *nt;
int err;

nt = alloc_and_init();
if (!nt) {
err = -ENOMEM;
goto fail;
}
--
pw-bot: cr

\
 
 \ /
  Last update: 2023-08-08 23:55    [W:0.026 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site