diff mbox series

[v2,17/63] xen-blkback: Use the enum req_op and blk_opf_t types

Message ID 20220629233145.2779494-18-bvanassche@acm.org (mailing list archive)
State New, archived
Headers show
Series Improve static type checking for request flags | expand

Commit Message

Bart Van Assche June 29, 2022, 11:30 p.m. UTC
Improve static type checking by using the enum req_op type for request
operations and the new blk_opf_t type for request flags.

Cc: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/block/xen-blkback/blkback.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Roger Pau Monne June 30, 2022, 7:17 a.m. UTC | #1
On Wed, Jun 29, 2022 at 04:30:59PM -0700, Bart Van Assche wrote:
> Improve static type checking by using the enum req_op type for request
> operations and the new blk_opf_t type for request flags.
> 
> Cc: Roger Pau Monné <roger.pau@citrix.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

Seems sensible:

Acked-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks, Roger.
diff mbox series

Patch

diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index a97f2bf5b01b..a5cf7f1e871c 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -442,7 +442,7 @@  static void free_req(struct xen_blkif_ring *ring, struct pending_req *req)
  * Routines for managing virtual block devices (vbds).
  */
 static int xen_vbd_translate(struct phys_req *req, struct xen_blkif *blkif,
-			     int operation)
+			     enum req_op operation)
 {
 	struct xen_vbd *vbd = &blkif->vbd;
 	int rc = -EACCES;
@@ -1193,8 +1193,8 @@  static int dispatch_rw_block_io(struct xen_blkif_ring *ring,
 	struct bio *bio = NULL;
 	struct bio **biolist = pending_req->biolist;
 	int i, nbio = 0;
-	int operation;
-	int operation_flags = 0;
+	enum req_op operation;
+	blk_opf_t operation_flags = 0;
 	struct blk_plug plug;
 	bool drain = false;
 	struct grant_page **pages = pending_req->segments;