Re: [PATCH -next] io_uring: Fix unused function warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/4/20 9:48 AM, Stefano Garzarella wrote:
> On Wed, Mar 04, 2020 at 03:53:52PM +0800, YueHaibing wrote:
>> If CONFIG_NET is not set, gcc warns:
>>
>> fs/io_uring.c:3110:12: warning: io_setup_async_msg defined but not used [-Wunused-function]
>>  static int io_setup_async_msg(struct io_kiocb *req,
>>             ^~~~~~~~~~~~~~~~~~
>>
>> There are many funcions wraped by CONFIG_NET, move them
>> together to simplify code, also fix this warning.
>>
>> Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
>> Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx>
>> ---
>>  fs/io_uring.c | 98 ++++++++++++++++++++++++++++++++++-------------------------
>>  1 file changed, 57 insertions(+), 41 deletions(-)
>>
> 
> Since the code under the ifdef/else/endif blocks now are huge, would it make
> sense to add some comments for better readability?
> 
> I mean something like this:
> 
> #if defined(CONFIG_NET)
> ...
> #else /* !CONFIG_NET */
> ...
> #endif /* CONFIG_NET */

I applied it with that addition. Also had to adapt it quite a bit, as
the prototypes changed. I'm guessing the branch used was a few days
old?

-- 
Jens Axboe




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux