public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring: initialize count variable to 0
@ 2023-01-24 12:58 Tom Rix
  2023-01-24 14:01 ` Pavel Begunkov
  2023-01-24 14:11 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Tom Rix @ 2023-01-24 12:58 UTC (permalink / raw)
  To: axboe, asml.silence, nathan, ndesaulniers
  Cc: io-uring, linux-kernel, llvm, Tom Rix

The clang build fails with
io_uring/io_uring.c:1240:3: error: variable 'count' is uninitialized
  when used here [-Werror,-Wuninitialized]
  count += handle_tw_list(node, &ctx, &uring_locked, &fake);
  ^~~~~

The commit listed in the fixes: removed the initialization of count.

Fixes: b5b57128d0cd ("io_uring: refactor tctx_task_work")
Signed-off-by: Tom Rix <[email protected]>
---
 io_uring/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 734d074cdd94..4cb409ae9840 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1227,7 +1227,7 @@ void tctx_task_work(struct callback_head *cb)
 	struct llist_node fake = {};
 	struct llist_node *node;
 	unsigned int loops = 0;
-	unsigned int count;
+	unsigned int count = 0;
 
 	if (unlikely(current->flags & PF_EXITING)) {
 		io_fallback_tw(tctx);
-- 
2.26.3


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

* Re: [PATCH] io_uring: initialize count variable to 0
  2023-01-24 12:58 [PATCH] io_uring: initialize count variable to 0 Tom Rix
@ 2023-01-24 14:01 ` Pavel Begunkov
  2023-01-24 14:11 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Pavel Begunkov @ 2023-01-24 14:01 UTC (permalink / raw)
  To: Tom Rix, axboe, nathan, ndesaulniers; +Cc: io-uring, linux-kernel, llvm

On 1/24/23 12:58, Tom Rix wrote:
> The clang build fails with
> io_uring/io_uring.c:1240:3: error: variable 'count' is uninitialized
>    when used here [-Werror,-Wuninitialized]
>    count += handle_tw_list(node, &ctx, &uring_locked, &fake);
>    ^~~~~
> 
> The commit listed in the fixes: removed the initialization of count.

My bad. The patch looks good, thanks


> Fixes: b5b57128d0cd ("io_uring: refactor tctx_task_work")
> Signed-off-by: Tom Rix <[email protected]>
> ---
>   io_uring/io_uring.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
> index 734d074cdd94..4cb409ae9840 100644
> --- a/io_uring/io_uring.c
> +++ b/io_uring/io_uring.c
> @@ -1227,7 +1227,7 @@ void tctx_task_work(struct callback_head *cb)
>   	struct llist_node fake = {};
>   	struct llist_node *node;
>   	unsigned int loops = 0;
> -	unsigned int count;
> +	unsigned int count = 0;
>   
>   	if (unlikely(current->flags & PF_EXITING)) {
>   		io_fallback_tw(tctx);

-- 
Pavel Begunkov

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

* Re: [PATCH] io_uring: initialize count variable to 0
  2023-01-24 12:58 [PATCH] io_uring: initialize count variable to 0 Tom Rix
  2023-01-24 14:01 ` Pavel Begunkov
@ 2023-01-24 14:11 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2023-01-24 14:11 UTC (permalink / raw)
  To: asml.silence, nathan, ndesaulniers, Tom Rix; +Cc: io-uring, linux-kernel, llvm


On Tue, 24 Jan 2023 04:58:05 -0800, Tom Rix wrote:
> The clang build fails with
> io_uring/io_uring.c:1240:3: error: variable 'count' is uninitialized
>   when used here [-Werror,-Wuninitialized]
>   count += handle_tw_list(node, &ctx, &uring_locked, &fake);
>   ^~~~~
> 
> The commit listed in the fixes: removed the initialization of count.
> 
> [...]

Applied, thanks!

[1/1] io_uring: initialize count variable to 0
      commit: 7a9e93db01f44a8d084c93648981cbc1535a734d

Best regards,
-- 
Jens Axboe




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

end of thread, other threads:[~2023-01-24 14:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-24 12:58 [PATCH] io_uring: initialize count variable to 0 Tom Rix
2023-01-24 14:01 ` Pavel Begunkov
2023-01-24 14:11 ` Jens Axboe

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