Re: [PATCH v1 1/1] ASoC: Intel: cht_bsw_rt5672: Drop unneeded NULL checks
From: Andy Shevchenko
Date: Tue Apr 28 2026 - 06:19:58 EST
On Tue, Apr 28, 2026 at 05:37:44PM +0900, Mark Brown wrote:
> On Tue, Apr 28, 2026 at 11:16:56AM +0300, Andy Shevchenko wrote:
> > On Tue, Apr 28, 2026 at 05:07:39PM +0900, Mark Brown wrote:
>
> > > There's also the fact that as part of support for optional clocks the
> > > clock API will quite happily consume NULL clocks.
>
> > This clock is not optional, it's always retrieved with devm_clk_get().
> > When the flow runs into these code pieces the mclk != NULL, and always
> > valid (excluding some unrelated to this driver strange data corruption cases,
> > of course).
>
> > But yes, the CCF APIs are NULL-aware for a long time.
>
> My point is that it makes no difference if the caller does the NULL
> check.
The dead code or always-true one is not welcome in the kernel, it increases
unneeded burden on maintaining and understanding. While your point is correct
the lesser the code base the better. I don't believe we ever get this clock
become conditional (optional) again.
--
With Best Regards,
Andy Shevchenko