mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: David Lechner <david@lechnology.com>,
	Henry Martin <bsdhenrymartin@gmail.com>,
	linux-clk@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>
Subject: Re: clk: davinci: Add NULL check in davinci_lpsc_clk_register()
Date: Wed, 2 Apr 2025 09:48:35 +0200	[thread overview]
Message-ID: <bb7f73c9-c004-4d2f-a54e-285d4753c583@web.de> (raw)
In-Reply-To: <7513fb2c-3abe-4c29-aa94-42f0efe93396@lechnology.com>

>> I propose to avoid duplicate source code also for the completion of
>> the corresponding exception handling.
>>
>> * You may avoid repeated function calls by using another label instead.
>>   https://wiki.sei.cmu.edu/confluence/display/c/MEM12-C.+Consider+using+a+goto+chain+when+leaving+a+function+on+error+when+using+and+releasing+resources#MEM12C.Considerusingagotochainwhenleavingafunctiononerrorwhenusingandreleasingresources-CompliantSolution(copy_process()fromLinuxkernel)
>
> That would be OK too.

Thanks for another bit of positive feedback.


>                       I didn't worry about it in this case though
> since we are only duplicating 1 very short line of code. And the
> smaller diff has a better chance of successfully backporting to older
> stable kernels that will also pick up this patch.

Such development concerns can be clarified further.


>> * How do you think about to benefit any more from the application of the attribute “__free”?
>>   https://elixir.bootlin.com/linux/v6.14-rc6/source/include/linux/slab.h#L472
>
> Not a good fit for this specific use case.

The acceptance might be growing for such a software design option.


Would you like to clarify any more why the function “kzalloc” is still called here
(instead of the variant “devm_kzalloc”)?
https://elixir.bootlin.com/linux/v6.14-rc6/source/drivers/clk/davinci/psc.c#L242

Regards,
Markus

  reply	other threads:[~2025-04-02  7:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-01 13:13 [PATCH v1] " Henry Martin
2025-04-01 14:05 ` David Lechner
2025-04-01 16:46 ` [PATCH] " Markus Elfring
2025-04-01 17:21   ` David Lechner
2025-04-02  7:48     ` Markus Elfring [this message]
2025-04-02 14:05       ` David Lechner
2025-04-24  3:14 ` [PATCH v1] " henry martin
2025-06-19 23:49 ` Stephen Boyd

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=bb7f73c9-c004-4d2f-a54e-285d4753c583@web.de \
    --to=markus.elfring@web.de \
    --cc=bsdhenrymartin@gmail.com \
    --cc=david@lechnology.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@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®