From: Daniel Wagner Date: Fri, 12 Apr 2024 10:58:34 +0000 (+0200) Subject: Revert "ioctl: Return NVMe status in nvme_directive_send_id_endir()" X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d559459389a5a1424d212787bd3dfc53840ef930;p=users%2Fsagi%2Flibnvme.git Revert "ioctl: Return NVMe status in nvme_directive_send_id_endir()" This reverts commit 2d2d76fa08bfd0a3f82cb9db051e53992b4bded2. The result field is undefined for many commands and thus can have random values. Thus we can't blindly evaluate these for all commands. Signed-off-by: Daniel Wagner --- diff --git a/src/nvme/ioctl.c b/src/nvme/ioctl.c index 4c9a1bce..ba475496 100644 --- a/src/nvme/ioctl.c +++ b/src/nvme/ioctl.c @@ -1533,8 +1533,6 @@ int nvme_directive_send_id_endir(int fd, __u32 nsid, bool endir, { __u32 cdw12 = NVME_SET(dtype, DIRECTIVE_SEND_IDENTIFY_CDW12_DTYPE) | NVME_SET(endir, DIRECTIVE_SEND_IDENTIFY_CDW12_ENDIR); - __u32 result = 0; - int err; struct nvme_directive_send_args args = { .args_size = sizeof(args), .fd = fd, @@ -1546,13 +1544,10 @@ int nvme_directive_send_id_endir(int fd, __u32 nsid, bool endir, .data_len = sizeof(*id), .data = id, .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, - .result = &result, + .result = NULL, }; - err = nvme_directive_send(&args); - if (err && result) - err = result; - return err; + return nvme_directive_send(&args); } int nvme_directive_recv(struct nvme_directive_recv_args *args)