Skip to content

Commit 2526055

Browse files
bvanasscheaxboe
authored andcommitted
null_blk: Fix two sparse warnings
Fix the following sparse warnings: drivers/block/null_blk/main.c:1243:35: warning: incorrect type in return expression (different base types) drivers/block/null_blk/main.c:1243:35: expected int drivers/block/null_blk/main.c:1243:35: got restricted blk_status_t drivers/block/null_blk/main.c:1291:30: warning: incorrect type in return expression (different base types) drivers/block/null_blk/main.c:1291:30: expected restricted blk_status_t drivers/block/null_blk/main.c:1291:30: got int Cc: Christoph Hellwig <[email protected]> Cc: Damien Le Moal <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 928b607 commit 2526055

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

drivers/block/null_blk/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ static int null_transfer(struct nullb *nullb, struct page *page,
12181218
return err;
12191219
}
12201220

1221-
static int null_handle_rq(struct nullb_cmd *cmd)
1221+
static blk_status_t null_handle_rq(struct nullb_cmd *cmd)
12221222
{
12231223
struct request *rq = blk_mq_rq_from_pdu(cmd);
12241224
struct nullb *nullb = cmd->nq->dev->nullb;

drivers/block/null_blk/trace.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ TRACE_EVENT(nullb_zone_op,
3636
TP_ARGS(cmd, zone_no, zone_cond),
3737
TP_STRUCT__entry(
3838
__array(char, disk, DISK_NAME_LEN)
39-
__field(enum req_op, op)
39+
/*
40+
* __field() uses is_signed_type(). is_signed_type() does not
41+
* support bitwise types. Use __field_struct() instead because
42+
* it does not use is_signed_type().
43+
*/
44+
__field_struct(enum req_op, op)
4045
__field(unsigned int, zone_no)
4146
__field(unsigned int, zone_cond)
4247
),

0 commit comments

Comments
 (0)