Thread (9 messages) read the whole thread 9 messages, 2 authors, 2023-03-14

Re: [PATCH 4/4] xen/blkback: move blkif_get_x86_*_req() into blkback.c

From: Roger Pau Monné <hidden>
Date: 2023-03-14 14:01:59
Also in: lkml, xen-devel

On Fri, Dec 16, 2022 at 03:58:16PM +0100, Juergen Gross wrote:
quoted hunk ↗ jump to hunk
There is no need to have the functions blkif_get_x86_32_req() and
blkif_get_x86_64_req() in a header file, as they are used in one place
only.

So move them into the using source file and drop the inline qualifier.

While at it fix some style issues, and simplify the code by variable
reusing and using min() instead of open coding it.

Instead of using barrier() use READ_ONCE() for avoiding multiple reads
of nr_segments.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 drivers/block/xen-blkback/blkback.c | 104 ++++++++++++++++++++++++++++
 drivers/block/xen-blkback/common.h  |  96 -------------------------
 2 files changed, 104 insertions(+), 96 deletions(-)
diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index 243712b59a05..7561fdb72c13 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -1072,7 +1072,111 @@ static void end_block_io_op(struct bio *bio)
 	bio_put(bio);
 }
 
+static void blkif_get_x86_32_req(struct blkif_request *dst,
+				 struct blkif_x86_32_request *src)
src can be const.
+{
+	int i, n;
Could we also take the opportunity to convert i and n to unsigned?

With that:

Acked-by: Roger Pau Monné <redacted>

Thanks, Roger.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help