drivers: npcx: replace type of register base address with uintptr_t

Replace npcx register base address type, uint32_t, with uintptr_t.
It is easier to know what type of base address and for linear
addresses treated as integral values.

This CL also modified IS_BIT_SET() macro function to fit MISRA code
guidelines.

Signed-off-by: Mulin Chao <MLChao@nuvoton.com>
This commit is contained in:
Mulin Chao 2020-08-31 17:31:16 +08:00 committed by Carles Cufí
commit b3188f1c32
3 changed files with 4 additions and 4 deletions

View file

@ -16,9 +16,9 @@ LOG_MODULE_REGISTER(clock_control_npcx, LOG_LEVEL_ERR);
/* Driver config */
struct npcx_pcc_config {
/* cdcg device base address */
uint32_t base_cdcg;
uintptr_t base_cdcg;
/* pmc device base address */
uint32_t base_pmc;
uintptr_t base_pmc;
};
/* Driver convenience defines */

View file

@ -14,7 +14,7 @@ LOG_MODULE_REGISTER(pimux_npcx, LOG_LEVEL_ERR);
/* Driver config */
struct npcx_pinctrl_config {
/* scfg device base address */
uint32_t base;
uintptr_t base;
};
/* Default io list which default functionality are not IOs */

View file

@ -10,7 +10,7 @@
/*
* NPCX register bit/field access operations
*/
#define IS_BIT_SET(reg, bit) ((reg >> bit) & (0x1))
#define IS_BIT_SET(reg, bit) (((reg >> bit) & (0x1)) != 0)
#define GET_POS_FIELD(pos, size) pos
#define GET_SIZE_FIELD(pos, size) size