From: linan666@huaweicloud.com
To: song@kernel.org, shli@fb.com, neilb@suse.com
Cc: mariusz.tkaczyk@linux.intel.com, linux-raid@vger.kernel.org,
linux-kernel@vger.kernel.org, linan666@huaweicloud.com,
yukuai3@huawei.com, yi.zhang@huawei.com, houtao1@huawei.com,
yangerkun@huawei.com
Subject: [PATCH v7 2/9] md: changed the switch of RAID_VERSION to if
Date: Mon, 26 Feb 2024 11:14:37 +0800 [thread overview]
Message-ID: <20240226031444.3606764-3-linan666@huaweicloud.com> (raw)
In-Reply-To: <20240226031444.3606764-1-linan666@huaweicloud.com>
From: Li Nan <linan122@huawei.com>
There is only one case of this 'switch'. Change it to 'if'.
Signed-off-by: Li Nan <linan122@huawei.com>
---
drivers/md/md.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 332eda680aea..b783a64765a7 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -7612,12 +7612,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:
--
2.39.2
next prev parent reply other threads:[~2024-02-26 3:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-26 3:14 [PATCH v7 0/9] bugfix of MD_CLOSING and clean up md_ioctl() linan666
2024-02-26 3:14 ` [PATCH v7 1/9] md: merge the check of capabilities into md_ioctl_valid() linan666
2024-02-26 3:14 ` linan666 [this message]
2024-02-26 3:14 ` [PATCH v7 3/9] md: clean up invalid BUG_ON in md_ioctl linan666
2024-02-26 3:14 ` [PATCH v7 4/9] md: return directly before setting did_set_md_closing linan666
2024-02-26 3:14 ` [PATCH v7 5/9] md: Don't clear MD_CLOSING when the raid is about to stop linan666
2024-02-26 3:14 ` [PATCH v7 6/9] md: factor out a helper to sync mddev linan666
2024-02-26 3:14 ` [PATCH v7 7/9] md: sync blockdev before stopping raid or setting readonly linan666
2024-02-26 3:14 ` [PATCH v7 8/9] md: clean up openers check in do_md_stop() and md_set_readonly() linan666
2024-02-26 3:14 ` [PATCH v7 9/9] md: check mddev->pers before calling md_set_readonly() linan666
2024-02-26 21:32 ` [PATCH v7 0/9] bugfix of MD_CLOSING and clean up md_ioctl() Song Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240226031444.3606764-3-linan666@huaweicloud.com \
--to=linan666@huaweicloud.com \
--cc=houtao1@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=mariusz.tkaczyk@linux.intel.com \
--cc=neilb@suse.com \
--cc=shli@fb.com \
--cc=song@kernel.org \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yukuai3@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).