Re: [PATCH 1/2] regulator: s2mps11: drop redundant sanity checks in s2mpg10_of_parse_cb()
From: Krzysztof Kozlowski
Date: Tue Feb 10 2026 - 05:51:23 EST
On 10/02/2026 10:37, André Draszik wrote:
> Hi Krzysztof,
>
> On Tue, 2026-02-10 at 08:28 +0100, Krzysztof Kozlowski wrote:
>> On 10/02/2026 06:59, André Draszik wrote:
>>> Hi Krzysztof,
>>>
>>> On Mon, 2026-02-09 at 17:09 +0100, Krzysztof Kozlowski wrote:
>>>> On 09/02/2026 16:07, André Draszik wrote:
>>>>> The sanity checks being removed in this commit are useless as earlier
>>>>> code checks for out-of-bounds conditions already. They also are
>>>>> incorrect (as they're off-by-one).
>>>>>
>>>>> Simply remove this incorrect code.
>>>>>
>>>>> No functional change.
>>>>
>>>> If they are incorrect then how it could be "no functional change"? To me
>>>> original code looks buggy and this is a fix. Fix must have functional
>>>> change...
>>>
>>> Earlier code already checks for all conditions, including all error cases.
>>> So the code being removed here has no effect, as any potential error it
>>> could catch will already have been caught by earlier code. Removing it
>>> therefore doesn't change behaviour or functionality.
>>>
>>> I can reword to 'incomplete test' instead of 'incorrect code' if you think
>>> that's more clear?
>>
>> Perhaps you should mention which "one" in off-by-one that it has no impact.
>
> OK.
>
>> I also wonder why you left the second - ext_control_s2mpg11 - untouched.
>
> Could you point me to it please? I'm not sure I see what you mean.
There is exact same line, which you touch here, ~20 lines below. At
least in linux-next from 5th Feb.
Best regards,
Krzysztof