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 <ikegami.t@gmail.com>
  • Loading branch information
ikegami-t committed Sep 16, 2024
1 parent 5585f06 commit a97875c
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 @@ -45,6 +45,14 @@
#define NVME_SET(value, name) \
(((__u32)(value) & NVME_##name##_MASK) << NVME_##name##_SHIFT)

/**
* 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 a97875c

Please sign in to comment.