drivers: npcx: Correct the macro parentheses
This corrects the following: 1. The priority of type cast is lower than member access. So don't need the redundant parentheses. 2. The macro should be added to the parentheses. Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
This commit is contained in:
parent
499cc72411
commit
3565f71a72
11 changed files with 13 additions and 13 deletions
|
@ -71,7 +71,7 @@ struct adc_npcx_data {
|
|||
|
||||
#define DRV_DATA(dev) ((struct adc_npcx_data *)(dev)->data)
|
||||
|
||||
#define HAL_INSTANCE(dev) (struct adc_reg *)(DRV_CONFIG(dev)->base)
|
||||
#define HAL_INSTANCE(dev) ((struct adc_reg *)DRV_CONFIG(dev)->base)
|
||||
|
||||
/* ADC local functions */
|
||||
static void adc_npcx_isr(void *arg)
|
||||
|
|
|
@ -26,10 +26,10 @@ struct npcx_pcc_config {
|
|||
((const struct npcx_pcc_config *)(dev)->config)
|
||||
|
||||
#define HAL_CDCG_INST(dev) \
|
||||
(struct cdcg_reg *)(DRV_CONFIG(dev)->base_cdcg)
|
||||
((struct cdcg_reg *)DRV_CONFIG(dev)->base_cdcg)
|
||||
|
||||
#define HAL_PMC_INST(dev) \
|
||||
(struct pmc_reg *)(DRV_CONFIG(dev)->base_pmc)
|
||||
((struct pmc_reg *)DRV_CONFIG(dev)->base_pmc)
|
||||
|
||||
/* Clock controller local functions */
|
||||
static inline int npcx_clock_control_on(const struct device *dev,
|
||||
|
|
|
@ -46,7 +46,7 @@ struct espi_npcx_data {
|
|||
|
||||
#define DRV_DATA(dev) ((struct espi_npcx_data *)(dev)->data)
|
||||
|
||||
#define HAL_INSTANCE(dev) (struct espi_reg *)(DRV_CONFIG(dev)->base)
|
||||
#define HAL_INSTANCE(dev) ((struct espi_reg *)DRV_CONFIG(dev)->base)
|
||||
|
||||
/* eSPI channels */
|
||||
#define NPCX_ESPI_CH_PC 0
|
||||
|
|
|
@ -47,7 +47,7 @@ struct gpio_npcx_data {
|
|||
|
||||
#define DRV_DATA(dev) ((struct gpio_npcx_data *)(dev)->data)
|
||||
|
||||
#define HAL_INSTANCE(dev) (struct gpio_reg *)(DRV_CONFIG(dev)->base)
|
||||
#define HAL_INSTANCE(dev) ((struct gpio_reg *)DRV_CONFIG(dev)->base)
|
||||
|
||||
/* Platform specific GPIO functions */
|
||||
const struct device *npcx_get_gpio_dev(int port)
|
||||
|
|
|
@ -154,10 +154,10 @@ struct i2c_ctrl_data {
|
|||
|
||||
#define DRV_DATA(dev) ((struct i2c_ctrl_data *)(dev)->data)
|
||||
|
||||
#define HAL_I2C_INSTANCE(dev) (struct smb_reg *)(DRV_CONFIG(dev)->base)
|
||||
#define HAL_I2C_INSTANCE(dev) ((struct smb_reg *)DRV_CONFIG(dev)->base)
|
||||
|
||||
#define HAL_I2C_FIFO_INSTANCE(dev) \
|
||||
(struct smb_fifo_reg *)(DRV_CONFIG(dev)->base)
|
||||
((struct smb_fifo_reg *)DRV_CONFIG(dev)->base)
|
||||
|
||||
/* Recommended I2C timing values are based on 15 MHz */
|
||||
static const struct npcx_i2c_timing_cfg npcx_15m_speed_confs[] = {
|
||||
|
|
|
@ -69,7 +69,7 @@ struct ps2_npcx_ctrl_data {
|
|||
|
||||
#define DRV_DATA(dev) ((struct ps2_npcx_ctrl_data *)(dev)->data)
|
||||
|
||||
#define HAL_PS2_INSTANCE(dev) (struct ps2_reg *)(DRV_CONFIG(dev)->base)
|
||||
#define HAL_PS2_INSTANCE(dev) ((struct ps2_reg *)DRV_CONFIG(dev)->base)
|
||||
|
||||
static uint8_t ps2_npcx_ctrl_get_ch_clk_mask(uint8_t channel_id)
|
||||
{
|
||||
|
|
|
@ -56,7 +56,7 @@ struct pwm_npcx_data {
|
|||
|
||||
#define DRV_DATA(dev) ((struct pwm_npcx_data *)(dev)->data)
|
||||
|
||||
#define HAL_INSTANCE(dev) (struct pwm_reg *)(DRV_CONFIG(dev)->base)
|
||||
#define HAL_INSTANCE(dev) ((struct pwm_reg *)DRV_CONFIG(dev)->base)
|
||||
|
||||
/* PWM local functions */
|
||||
static void pwm_npcx_configure(const struct device *dev, int clk_bus)
|
||||
|
|
|
@ -79,7 +79,7 @@ struct tach_npcx_data {
|
|||
|
||||
#define DRV_DATA(dev) ((struct tach_npcx_data *)(dev)->data)
|
||||
|
||||
#define HAL_INSTANCE(dev) (struct tach_reg *)(DRV_CONFIG(dev)->base)
|
||||
#define HAL_INSTANCE(dev) ((struct tach_reg *)DRV_CONFIG(dev)->base)
|
||||
|
||||
/* Maximum count of prescaler */
|
||||
#define NPCX_TACHO_PRSC_MAX 0xff
|
||||
|
|
|
@ -61,7 +61,7 @@ struct uart_npcx_data {
|
|||
|
||||
#define DRV_DATA(dev) ((struct uart_npcx_data *)(dev)->data)
|
||||
|
||||
#define HAL_INSTANCE(dev) (struct uart_reg *)(DRV_CONFIG(dev)->uconf.base)
|
||||
#define HAL_INSTANCE(dev) ((struct uart_reg *)DRV_CONFIG(dev)->uconf.base)
|
||||
|
||||
#if defined(CONFIG_PM) && defined(CONFIG_UART_INTERRUPT_DRIVEN)
|
||||
static void uart_npcx_pm_constraint_set(struct uart_npcx_data *data,
|
||||
|
|
|
@ -31,7 +31,7 @@ struct npcx_spi_fiu_data {
|
|||
/* Driver convenience defines */
|
||||
#define DRV_CONFIG(dev) ((const struct npcx_spi_fiu_config *)(dev)->config)
|
||||
#define DRV_DATA(dev) ((struct npcx_spi_fiu_data *)(dev)->data)
|
||||
#define HAL_INSTANCE(dev) (struct fiu_reg *)(DRV_CONFIG(dev)->base)
|
||||
#define HAL_INSTANCE(dev) ((struct fiu_reg *)DRV_CONFIG(dev)->base)
|
||||
|
||||
static inline void spi_npcx_fiu_cs_level(const struct device *dev, int level)
|
||||
{
|
||||
|
|
|
@ -84,7 +84,7 @@ struct miwu_dev_callback miwu_cb;
|
|||
/* Driver convenience defines */
|
||||
#define DRV_CONFIG(dev) ((const struct wdt_npcx_config *)(dev)->config)
|
||||
#define DRV_DATA(dev) ((struct wdt_npcx_data *)(dev)->data)
|
||||
#define HAL_INSTANCE(dev) (struct twd_reg *)(DRV_CONFIG(dev)->base)
|
||||
#define HAL_INSTANCE(dev) ((struct twd_reg *)DRV_CONFIG(dev)->base)
|
||||
|
||||
/* WDT local inline functions */
|
||||
static inline int wdt_t0out_reload(const struct device *dev)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue