[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1e84c070-ab32-4617-bd6a-352f2a744004@gmail.com>
Date: Thu, 27 Feb 2025 14:54:14 +0000
From: Pavel Begunkov <asml.silence@...il.com>
To: Arnd Bergmann <arnd@...nel.org>, Jens Axboe <axboe@...nel.dk>
Cc: Arnd Bergmann <arnd@...db.de>, Gabriel Krisman Bertazi <krisman@...e.de>,
David Wei <dw@...idwei.uk>, io-uring@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] io_uring/net: fix build warning for !CONFIG_COMPAT
On 2/27/25 13:49, Pavel Begunkov wrote:
> On 2/27/25 13:20, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@...db.de>
>>
>> A code rework resulted in an uninitialized return code when COMPAT
>> mode is disabled:
>
> As mentioned in the lkp report, it should be a false positive.
>
>>
>> io_uring/net.c:722:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
>> 722 | if (io_is_compat(req->ctx)) {
>> | ^~~~~~~~~~~~~~~~~~~~~~
>> io_uring/net.c:736:15: note: uninitialized use occurs here
>> 736 | if (unlikely(ret))
>> | ^~~
>>
>> Since io_is_compat() turns into a compile-time 'false', the #ifdef
>> here is completely unnecessary, and removing it avoids the warning.
>
> I don't think __get_compat_msghdr() and other helpers are
> compiled for !COMPAT. I'd just silence it like:
I guess we're relying on dead code elimination to prevent
linking against them, if that's a normal practise and we
do mandate compilers to do that, then it looks fine to me
>
> if (io_is_compat(req->ctx)) {
> ret = -EFAULT;
> #ifdef CONFIG_COMPAT
> ...
> #endif CONFIG_COMPAT
> }
>
> Let's see if Jens wants to fix it up in the tree.
>
--
Pavel Begunkov
Powered by blists - more mailing lists