Skip to content

Conversation

@ikegami-t
Copy link
Contributor

No description provided.

nvme-print.c Outdated
ops->show_status(status);
}

int nvme_show_err(const char *msg, int err)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this function should not return an error code, so void nvme_show_err.

Copy link
Collaborator

@igaw igaw Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see why you pass the error code back. I think we should follow more the traditional style of

if (err) {
   nvme_show_err(err, "oh no!");
   return err;
}

The rest looks great. Really nice cleanup!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay will do fix as mentioned. Thank you.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just fixed the patch as mentioned. But sorry still nvme_show_opcode_status not added to the nvme_show_err as mentioned by the PR comment: #3056 (comment) so later will do it.

This handles the negative error code and the postive status code.
  Note: Fix also to handle the negative error for nvme_strerror().

Fixes: 4fb93ad ("nvme-cli: update error handling")
Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants