Replace user_id masks with a macro (#8)

In multiple places throughout ipmi_user.c a user id mask
was used as a magic number, in some places the mask was wrong.
This commit replaces all those magic numbers with a single
IPMI_UID() macro.

Resolves ipmitool/ipmitool#6
This commit is contained in:
Alexander Amelkin
2018-05-30 18:57:20 +03:00
committed by GitHub
parent 564aef2aff
commit 432f06db3f
2 changed files with 12 additions and 7 deletions

View File

@@ -48,6 +48,9 @@
#define IPMI_USER_ENABLE_DISABLED 0x80
#define IPMI_USER_ENABLE_RESERVED 0xC0
#define IPMI_UID_MASK 0x3F /* The user_id is 6-bit and is usually in bits [5:0] */
#define IPMI_UID(id) ((id) & IPMI_UID_MASK)
/* (22.27) Get and (22.26) Set User Access */
struct user_access_t {
uint8_t callin_callback;