[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bb7f73c9-c004-4d2f-a54e-285d4753c583@web.de>
Date: Wed, 2 Apr 2025 09:48:35 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: David Lechner <david@...hnology.com>,
Henry Martin <bsdhenrymartin@...il.com>, linux-clk@...r.kernel.org
Cc: LKML <linux-kernel@...r.kernel.org>,
Michael Turquette <mturquette@...libre.com>, Stephen Boyd <sboyd@...nel.org>
Subject: Re: clk: davinci: Add NULL check in davinci_lpsc_clk_register()
>> 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
Powered by blists - more mailing lists