diff options
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2025-02-16 12:12:39 +0100 |
---|---|---|
committer | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2025-02-20 11:09:33 +0100 |
commit | 08573d7688a8c133bd4a7354cf928f96e778b42a (patch) | |
tree | 3cf25acfe9347ff44356717f5f80894643e0c307 /include/lmb.h | |
parent | bd8bc53162edde1970c04c472a8058c69bd71f3d (diff) |
lmb: avoid superfluous value check in lmb_map_update_notify()
Instead of testing the value of parameter op at runtime use an enum to
ensure that only valid values are used.
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'include/lmb.h')
-rw-r--r-- | include/lmb.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/lmb.h b/include/lmb.h index d9d7435a431..09297a4f530 100644 --- a/include/lmb.h +++ b/include/lmb.h @@ -32,6 +32,18 @@ #define LMB_NONOTIFY BIT(2) /** + * enum lmb_map_op - memory map operation + */ +enum lmb_map_op { + /** @LMB_MAP_OP_RESERVE: reserve memory */ + LMB_MAP_OP_RESERVE = 1, + /** @LMB_MAP_OP_FREE: free memory */ + LMB_MAP_OP_FREE, + /** @LMB_MAP_OP_ADD: add memory */ + LMB_MAP_OP_ADD, +}; + +/** * struct lmb_region - Description of one region * @base: Base address of the region * @size: Size of the region |