public inbox for [email protected]
 help / color / mirror / Atom feed
* [v2 PATCH] io_uring: rsrc: Optimize return value variable 'ret'
@ 2023-03-17 18:25 Li zeming
  2023-03-16  2:00 ` Jens Axboe
  2023-03-16 13:17 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Li zeming @ 2023-03-17 18:25 UTC (permalink / raw)
  To: axboe, asml.silence; +Cc: io-uring, linux-kernel, Li zeming

The initialization assignment of the variable ret is changed to 0, only
in 'goto fail;' Use the ret variable as the function return value.

Signed-off-by: Li zeming <[email protected]>
---
 v2: Modify the initialization value of ret variable.

 io_uring/rsrc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c
index 056f40946ff6..09a16d709cb5 100644
--- a/io_uring/rsrc.c
+++ b/io_uring/rsrc.c
@@ -410,7 +410,7 @@ __cold static int io_rsrc_data_alloc(struct io_ring_ctx *ctx,
 				     unsigned nr, struct io_rsrc_data **pdata)
 {
 	struct io_rsrc_data *data;
-	int ret = -ENOMEM;
+	int ret = 0;
 	unsigned i;
 
 	data = kzalloc(sizeof(*data), GFP_KERNEL);
-- 
2.18.2


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

end of thread, other threads:[~2023-03-16 13:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-17 18:25 [v2 PATCH] io_uring: rsrc: Optimize return value variable 'ret' Li zeming
2023-03-16  2:00 ` Jens Axboe
2023-03-16 13:17 ` Jens Axboe

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