Skip to content

Commit

Permalink
types: add NVME_VAL() definition
Browse files Browse the repository at this point in the history
This is to get the field mask value shifted.

Signed-off-by: Tokunori Ikegami <[email protected]>
  • Loading branch information
ikegami-t authored and igaw committed Sep 16, 2024
1 parent 8194960 commit e3129c1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/nvme/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@
*/
#define NVME_CHECK(value, name, check) ((value) == NVME_##name##_##check)

/**
* NVME_VAL() - get mask value shifted
* @name: The name of the sub-field within an nvme value
*
* Returns: The mask value shifted
*/
#define NVME_VAL(name) (NVME_##name##_MASK << NVME_##name##_SHIFT)

/**
* enum nvme_constants - A place to stash various constant nvme values
* @NVME_NSID_ALL: A broadcast value that is used to specify all
Expand Down

0 comments on commit e3129c1

Please sign in to comment.