lkml.org 
[lkml]   [2022]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v1 1/7] selftests/vm: anon_cow: test COW handling of anonymous memory
From
>> +	/* See if we still read the old values via the pipe. */
>> + for (total = 0; total < transferred; total += cur) {
>> + cur = read(fds[0], new + total, transferred - total);
>> + if (cur < 0)
>
> Hi David,
> I was looking at some coccinelle reports for linux-next and
> saw the following warning for this comparison:
>
> WARNING: Unsigned expression compared with zero: cur < 0
>
> I think 'cur' needs to be of type 'ssize_t' for this comparison to work.
>
> The same warning is reported for the variable 'transferred' above, and
> also for do_test_iouring() and do_test_vmsplice_in_parent() in
> "selftests/vm: anon_cow: add liburing test cases".
>

Thanks for reporting! Indeed, we need a signed value.

--
Thanks,

David / dhildenb

\
 
 \ /
  Last update: 2022-10-25 09:06    [W:0.079 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site