Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

block/floppy: Fix a sparse warning

Since the type of request.cmd_flags has been changed from u32 into
blk_opf_t, use the __force keyword when casting to an integer type to
prevent that sparse warns about this cast.

Cc: Denis Efremov <efremov@linux.com>
Cc: Willy Tarreau <w@1wt.eu>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20220714180729.1065367-16-bvanassche@acm.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Bart Van Assche and committed by
Jens Axboe
23f8ae71 86563de8

+1 -1
+1 -1
drivers/block/floppy.c
··· 2859 2859 if (WARN(atomic_read(&usage_count) == 0, 2860 2860 "warning: usage count=0, current_req=%p sect=%ld flags=%llx\n", 2861 2861 current_req, (long)blk_rq_pos(current_req), 2862 - (unsigned long long) current_req->cmd_flags)) 2862 + (__force unsigned long long) current_req->cmd_flags)) 2863 2863 return BLK_STS_IOERR; 2864 2864 2865 2865 if (test_and_set_bit(0, &fdc_busy)) {