mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Mikulas Patocka <mpatocka@redhat.com>, dm-devel@lists.linux.dev
Cc: Alasdair Kergon <agk@redhat.com>,
	Benjamin Marzinski <bmarzins@redhat.com>,
	Mike Snitzer <snitzer@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: dm: Use common error handling code in three functions
Date: Thu, 11 Jun 2026 07:33:25 +0200	[thread overview]
Message-ID: <3b8e5056-0611-43eb-9fc3-c82f0511d466@web.de> (raw)
In-Reply-To: <d802f7e7-9ed7-e7f9-89c5-19cdc9806367@redhat.com>

>> Use additional labels so that a bit of exception handling can be better
>> reused at the end of three if branches.
>>
>> This issue was detected by using the Coccinelle software.
> 
> Hi
> 
> I think that jumping into a nested block isn't good practice and it makes 
> the code harder to read and maintain. I would redo the patches so that 
> they jump to the end of the topmost function block, for example:
Thanks for your constructive feedback.

Can any further adjustments become feasible for the design goal “Centralized exiting of functions”?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v7.1-rc7#n526

Would you find goto chains applicable for another while?
https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/recommendations/memory-management-mem/mem12-c/

How do you think about to increase the application of scope-based resource management?
https://elixir.bootlin.com/linux/v7.1-rc7/source/include/linux/cleanup.h

Regards,
Markus

  reply	other threads:[~2026-06-11  5:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09 20:00 [PATCH] " Markus Elfring
2026-06-10 19:49 ` Mikulas Patocka
2026-06-11  5:33   ` Markus Elfring [this message]
2026-06-11 13:25     ` Mikulas Patocka

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=3b8e5056-0611-43eb-9fc3-c82f0511d466@web.de \
    --to=markus.elfring@web.de \
    --cc=agk@redhat.com \
    --cc=bmarzins@redhat.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=snitzer@kernel.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

all inboxes | Powered by JetHome®