lkml.org 
[lkml]   [2020]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: linux-5.7-rc4/fs/io_uring.c:2786: bad if test ?
From
Date
On 5/4/20 2:12 AM, David Binderman wrote:
> Hello there,
>
> linux-5.7-rc4/fs/io_uring.c:2786:6: warning: Identical condition 'force_nonblock', second condition is always false [identicalConditionAfterEarlyExit]
>
> Source code is
>
> if (force_nonblock)
> return -EAGAIN;
>
> poff_in = (sp->off_in == -1) ? NULL : &sp->off_in;
> poff_out = (sp->off_out == -1) ? NULL : &sp->off_out;
> ret = do_splice(in, poff_in, out, poff_out, sp->len, flags);
> if (force_nonblock && ret == -EAGAIN)
> return -EAGAIN;
>
> So the second return can never execute. Suggest code rework.

Looks like that's a leftover of the "only punt sometimes" code. That
second one is indeed dead now, Pavel is re-working the async punt
for 5.8 anyway so I don't think it's worth touching at this point.

--
Jens Axboe

\
 
 \ /
  Last update: 2020-05-04 15:49    [W:0.022 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site