]> git.baikalelectronics.ru Git - kernel.git/commitdiff
dm/dm-flakey: Use the new blk_opf_t type
authorBart Van Assche <bvanassche@acm.org>
Thu, 14 Jul 2022 18:06:51 +0000 (11:06 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 14 Jul 2022 18:14:31 +0000 (12:14 -0600)
Use the new blk_opf_t type for structure members that represent request
flags.

Cc: Alasdair Kergon <agk@redhat.com>
Cc: Mike Snitzer <snitzer@kernel.org>
Cc: Josef Bacik <josef@toxicpanda.com>
Cc: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20220714180729.1065367-26-bvanassche@acm.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/dm-flakey.c

index f2305eb758a25e637f44f8c05d1d95be59db56d8..89fa7a68c6c422ccc71c82fe84dddc17534bb347 100644 (file)
@@ -32,7 +32,7 @@ struct flakey_c {
        unsigned corrupt_bio_byte;
        unsigned corrupt_bio_rw;
        unsigned corrupt_bio_value;
-       unsigned corrupt_bio_flags;
+       blk_opf_t corrupt_bio_flags;
 };
 
 enum feature_flag_bits {
@@ -145,7 +145,11 @@ static int parse_features(struct dm_arg_set *as, struct flakey_c *fc,
                        /*
                         * Only corrupt bios with these flags set.
                         */
-                       r = dm_read_arg(_args + 3, as, &fc->corrupt_bio_flags, &ti->error);
+                       BUILD_BUG_ON(sizeof(fc->corrupt_bio_flags) !=
+                                    sizeof(unsigned int));
+                       r = dm_read_arg(_args + 3, as,
+                               (__force unsigned *)&fc->corrupt_bio_flags,
+                               &ti->error);
                        if (r)
                                return r;
                        argc--;