]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
md: changed the switch of RAID_VERSION to if
authorLi Nan <linan122@huawei.com>
Mon, 26 Feb 2024 03:14:37 +0000 (11:14 +0800)
committerSong Liu <song@kernel.org>
Mon, 26 Feb 2024 18:22:22 +0000 (10:22 -0800)
There is only one case of this 'switch'. Change it to 'if'.

Signed-off-by: Li Nan <linan122@huawei.com>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20240226031444.3606764-3-linan666@huaweicloud.com
drivers/md/md.c

index eedb9e343840833991d426bd807cf5040a88d993..3c8a0784cf6ac0cf13bef7a08b4192a3369a855b 100644 (file)
@@ -7613,12 +7613,8 @@ static int md_ioctl(struct block_device *bdev, blk_mode_t mode,
         * Commands dealing with the RAID driver but not any
         * particular array:
         */
-       switch (cmd) {
-       case RAID_VERSION:
-               err = get_version(argp);
-               goto out;
-       default:;
-       }
+       if (cmd == RAID_VERSION)
+               return get_version(argp);
 
        /*
         * Commands creating/starting a new array: