Skip to content

Commit

Permalink
types: add NVME_CHECK() definition to check nvme register field value
Browse files Browse the repository at this point in the history
This checks the value to compare the field value and returns the result.

Signed-off-by: Tokunori Ikegami <[email protected]>
  • Loading branch information
ikegami-t authored and igaw committed Sep 16, 2024
1 parent 79c73e6 commit 62430ff
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/nvme/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
#define NVME_SET(value, name) \
(((__u32)(value) & NVME_##name##_MASK) << NVME_##name##_SHIFT)

/**
* NVME_CHECK() - check value to compare field value
* @value: The value to be checked
* @name: The name of the sub-field within an nvme value
* @check: The sub-field value to check
*
* Returns: The result of compare the value and the sub-field value
*/
#define NVME_CHECK(value, name, check) ((value) == NVME_##name##_##check)

/**
* 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 62430ff

Please sign in to comment.