Re: [PATCH v5 1/5] selftests/mm: make file helpers return errors

From: David Hildenbrand (Arm)

Date: Mon Jul 27 2026 - 14:15:59 EST


On 7/22/26 20:57, John Hubbard wrote:
> On 7/21/26 10:24 PM, Sarthak Sharma wrote:
>> Hi David and Mark!
>>
>> On 7/21/26 8:24 PM, David Hildenbrand (Arm) wrote:
>>>
>>>
>>> Right, and if we want to move this to tools/lib/mm later, maybe we can just not
>>> print anything and instead only return expressive errnos.
>>>
>>
>> Yes, we are not using ksft_* prints here because these functions move to
>> tools/lib/mm later in the series.
>>
>> Printing errors from the helpers was suggested by Mike [1]. I also think
>> this is useful since the diagnostic handling stays at one place, instead
>> of duplicating it in every caller.
>
> This is a common pitfall. In fact, the lower ("leaf") routines, *especially*
> library-like functions that are called by disparate callers, should be
> usually be silent.

Yes, agreed!

--
Cheers,

David