Re: [PATCH] list: add missing empty list check to list_cut_before()
From: Andy Shevchenko
Date: Wed Sep 16 2026 - 12:13:50 EST
On Wed, Sep 16, 2026 at 07:11:12PM +0800, Ziran Zhang wrote:
> On Wed, 16 Sep 2026 13:53:56 +0300, Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> > Is it IRL case or the code analysis? If the former, add necessary information
> > like hardware description (if applicable) and the important ~3-5 lines from
> > traceback (I assume you rung with CONFIG_LIST_DEBUG=y).
>
> It is code analysis, not an IRL case. The motivation is consistency
> with list_cut_position(), which already has the same guard.
>
> > Nice! Where is the test case?
>
> There is no test case. If a test is required for this change, I can
> try to add one. I wanted to first check whether the consistency
> argument alone is acceptable.
Any new code to lib must be accompanied with a test case(s) as documented [1].
Look at lib/tests/, there is already a set of them.
[1] 0a83293322fd ("doc: development-process: add notice on testing")
--
With Best Regards,
Andy Shevchenko