From 08573d7688a8c133bd4a7354cf928f96e778b42a Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sun, 16 Feb 2025 12:12:39 +0100 Subject: 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 Signed-off-by: Heinrich Schuchardt --- include/lmb.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/lmb.h b/include/lmb.h index d9d7435a431..09297a4f530 100644 --- a/include/lmb.h +++ b/include/lmb.h @@ -31,6 +31,18 @@ #define LMB_NOOVERWRITE BIT(1) #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 -- cgit v1.3.1