[PATCH 1/2] nvme-core: cleanup nvme_pr_type()
Christoph Hellwig
hch at lst.de
Tue Nov 3 13:08:23 EST 2020
On Thu, Oct 29, 2020 at 11:59:57AM -0700, Chaitanya Kulkarni wrote:
> The switch in the nvme_pr_type() returns values which can be mapped 1:1
> on the PR_XXX macors. Get rid of the long switch and replace with simple
> conditional operator to return the value.
We'd need BUILD_BUG_ON statements to check this all actually maps.
At which point just doing the mapping as done in the current code seem
much more sensible for something that isn't exactly a fast path.
More information about the Linux-nvme
mailing list