Re: [PATCH v2 1/1] netlabel: cleanup struct netlbl_lsm_catmap

From: Paul Moore
Date: Sun Feb 04 2024 - 10:00:50 EST


On Sat, Feb 3, 2024 at 9:35 PM George Guo <dongtai.guo@xxxxxxxxx> wrote:
>
> From: George Guo <guodongtai@xxxxxxxxxx>
>
> Simplify the code from macro NETLBL_CATMAP_MAPTYPE to u64, and fix
> warning "Macros with complex values should be enclosed in parentheses"
> on "#define NETLBL_CATMAP_BIT (NETLBL_CATMAP_MAPTYPE)0x01", which is
> modified to "#define NETLBL_CATMAP_BIT ((u64)0x01)".
>
> Signed-off-by: George Guo <guodongtai@xxxxxxxxxx>
> ---
> V2:
> Yes, I understand what you are saying.
> Actually, there is a compile warnings on "#define NETLBL_CATMAP_BIT (NETLBL_CATMAP_MAPTYPE)0x01"
> which is missing parentheses.
> ---
> include/net/netlabel.h | 7 +++----
> net/netlabel/netlabel_kapi.c | 8 ++++----
> 2 files changed, 7 insertions(+), 8 deletions(-)

This is a much better approach, thank you.

Acked-by: Paul Moore <paul@xxxxxxxxxxxxxx>

--
paul-moore.com