netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Breno Leitao <leitao@debian.org>
Cc: rdunlap@infradead.org, benjamin.poirier@gmail.com,
	davem@davemloft.net, edumazet@google.com,
	Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org (open list)
Subject: Re: [PATCH net-next v4 1/2] netconsole: Create a allocation helper
Date: Tue, 8 Aug 2023 14:55:25 -0700	[thread overview]
Message-ID: <20230808145525.61840a76@kernel.org> (raw)
In-Reply-To: <20230804124322.113506-2-leitao@debian.org>

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

  reply	other threads:[~2023-08-08 21:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-04 12:43 [PATCH net-next v4 0/2] netconsole: Enable compile time configuration Breno Leitao
2023-08-04 12:43 ` [PATCH net-next v4 1/2] netconsole: Create a allocation helper Breno Leitao
2023-08-08 21:55   ` Jakub Kicinski [this message]
2023-08-04 12:43 ` [PATCH net-next v4 2/2] netconsole: Enable compile time configuration Breno Leitao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230808145525.61840a76@kernel.org \
    --to=kuba@kernel.org \
    --cc=benjamin.poirier@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rdunlap@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).