public inbox for [email protected]
 help / color / mirror / Atom feed
* Re: [PATCH] io_uring: re-issue plug based block requests that failed
@ 2020-06-05 22:05 Sedat Dilek
  2020-06-05 22:13 ` Sedat Dilek
  2020-06-05 22:27 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Sedat Dilek @ 2020-06-05 22:05 UTC (permalink / raw)
  To: Jens Axboe; +Cc: io-uring

Hi Jens,

with clang-10 I see this new warning in my build-log:

fs/io_uring.c:5958:2: warning: variable 'ret' is used uninitialized
whenever switch default is taken [-Wsometimes-uninitialized]
        default:
        ^~~~~~~
fs/io_uring.c:5972:27: note: uninitialized use occurs here
        io_cqring_add_event(req, ret);
                                 ^~~
fs/io_uring.c:5944:13: note: initialize the variable 'ret' to silence
this warning
        ssize_t ret;
                   ^
                    = 0
1 warning generated.

Thanks.

Regards,
- Sedat -

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] io_uring: re-issue plug based block requests that failed
  2020-06-05 22:05 [PATCH] io_uring: re-issue plug based block requests that failed Sedat Dilek
@ 2020-06-05 22:13 ` Sedat Dilek
  2020-06-05 22:27 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Sedat Dilek @ 2020-06-05 22:13 UTC (permalink / raw)
  To: Jens Axboe; +Cc: io-uring

On Sat, Jun 6, 2020 at 12:05 AM Sedat Dilek <[email protected]> wrote:
>
> Hi Jens,
>
> with clang-10 I see this new warning in my build-log:
>
> fs/io_uring.c:5958:2: warning: variable 'ret' is used uninitialized
> whenever switch default is taken [-Wsometimes-uninitialized]
>         default:
>         ^~~~~~~
> fs/io_uring.c:5972:27: note: uninitialized use occurs here
>         io_cqring_add_event(req, ret);
>                                  ^~~
> fs/io_uring.c:5944:13: note: initialize the variable 'ret' to silence
> this warning
>         ssize_t ret;
>                    ^
>                     = 0
> 1 warning generated.
>
> Thanks.
>

This siliences the warning:

$ git diff fs/io_uring.c
diff --git a/fs/io_uring.c b/fs/io_uring.c
index d22830a423f1..b94ad5963e41 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -5941,7 +5941,7 @@ static bool io_resubmit_prep(struct io_kiocb *req)
 {
        struct iovec inline_vecs[UIO_FASTIOV], *iovec = inline_vecs;
        struct iov_iter iter;
-       ssize_t ret;
+       ssize_t ret = 0;
        int rw;

        switch (req->opcode) {

- Sedat -

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] io_uring: re-issue plug based block requests that failed
  2020-06-05 22:05 [PATCH] io_uring: re-issue plug based block requests that failed Sedat Dilek
  2020-06-05 22:13 ` Sedat Dilek
@ 2020-06-05 22:27 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2020-06-05 22:27 UTC (permalink / raw)
  To: sedat.dilek; +Cc: io-uring

On 6/5/20 4:05 PM, Sedat Dilek wrote:
> Hi Jens,
> 
> with clang-10 I see this new warning in my build-log:
> 
> fs/io_uring.c:5958:2: warning: variable 'ret' is used uninitialized
> whenever switch default is taken [-Wsometimes-uninitialized]
>         default:
>         ^~~~~~~
> fs/io_uring.c:5972:27: note: uninitialized use occurs here
>         io_cqring_add_event(req, ret);
>                                  ^~~
> fs/io_uring.c:5944:13: note: initialize the variable 'ret' to silence
> this warning
>         ssize_t ret;
>                    ^
>                     = 0
> 1 warning generated.

Thanks! I'll fold in the fix.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-05 22:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-05 22:05 [PATCH] io_uring: re-issue plug based block requests that failed Sedat Dilek
2020-06-05 22:13 ` Sedat Dilek
2020-06-05 22:27 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox