]> www.infradead.org Git - users/hch/nvme-cli.git/commitdiff
nvme: refactoring unnecessary functions
authorSteven Seungcheol Lee <sc108.lee@samsung.com>
Fri, 17 Apr 2020 11:34:21 +0000 (20:34 +0900)
committerKeith Busch <kbusch@kernel.org>
Fri, 17 Apr 2020 19:14:04 +0000 (13:14 -0600)
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
nvme-ioctl.c
nvme-ioctl.h
nvme.c

index a6862ed026f9d0117630c668fc2c0191242278cb..f3f17da3ceddc3219b4f45fe36f7fc044a6e3007 100644 (file)
@@ -727,16 +727,6 @@ int nvme_ns_attachment(int fd, __u32 nsid, __u16 num_ctrls, __u16 *ctrlist,
        return nvme_submit_admin_passthru(fd, &cmd);
 }
 
-int nvme_ns_attach_ctrls(int fd, __u32 nsid, __u16 num_ctrls, __u16 *ctrlist)
-{
-       return nvme_ns_attachment(fd, nsid, num_ctrls, ctrlist, true);
-}
-
-int nvme_ns_detach_ctrls(int fd, __u32 nsid, __u16 num_ctrls, __u16 *ctrlist)
-{
-       return nvme_ns_attachment(fd, nsid, num_ctrls, ctrlist, false);
-}
-
 int nvme_fw_download(int fd, __u32 offset, __u32 data_len, void *data)
 {
        struct nvme_admin_cmd cmd = {
index f8de98cd7986cc9595ea55f96655a025bfe9c3a8..aae4e494e3d03c176cf0b8108544dd267bf73944 100644 (file)
@@ -125,8 +125,6 @@ int nvme_ns_delete(int fd, __u32 nsid, __u32 timeout);
 
 int nvme_ns_attachment(int fd, __u32 nsid, __u16 num_ctrls,
                       __u16 *ctrlist, bool attach);
-int nvme_ns_attach_ctrls(int fd, __u32 nsid, __u16 num_ctrls, __u16 *ctrlist);
-int nvme_ns_detach_ctrls(int fd, __u32 nsid, __u16 num_ctrls, __u16 *ctrlist);
 
 int nvme_fw_download(int fd, __u32 offset, __u32 data_len, void *data);
 int nvme_fw_commit(int fd, __u8 slot, __u8 action, __u8 bpid);
diff --git a/nvme.c b/nvme.c
index dd3ab5870e62209d5674c4216b4d92818ecd2720..903cffcfa6bc404fd5b36a8e3e23caeff5ede60e 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -1098,10 +1098,7 @@ static int nvme_attach_ns(int argc, char **argv, int attach, const char *desc, s
        for (i = 0; i < num; i++)
                ctrlist[i] = (uint16_t)list[i];
 
-       if (attach)
-               err = nvme_ns_attach_ctrls(fd, cfg.namespace_id, num, ctrlist);
-       else
-               err = nvme_ns_detach_ctrls(fd, cfg.namespace_id, num, ctrlist);
+       err = nvme_ns_attachment(fd, cfg.namespace_id, num, ctrlist, attach);
 
        if (!err)
                printf("%s: Success, nsid:%d\n", cmd->name, cfg.namespace_id);