Merge "Enable -Wlogical-op always" into integration
diff --git a/Makefile b/Makefile
index 0582061..d634b33 100644
--- a/Makefile
+++ b/Makefile
@@ -246,7 +246,6 @@
WARNING2 := -Waggregate-return
WARNING2 += -Wcast-align
WARNING2 += -Wnested-externs
-WARNING2 += -Wlogical-op
WARNING3 := -Wbad-function-cast
WARNING3 += -Wcast-qual
@@ -268,13 +267,13 @@
# Compiler specific warnings
ifeq ($(findstring clang,$(notdir $(CC))),)
# not using clang
-WARNINGS += -Wunused-but-set-variable \
- -Wmaybe-uninitialized \
- -Wpacked-bitfield-compat \
- -Wshift-overflow=2
+WARNINGS += -Wunused-but-set-variable -Wmaybe-uninitialized \
+ -Wpacked-bitfield-compat -Wshift-overflow=2 \
+ -Wlogical-op
else
# using clang
-WARNINGS += -Wshift-overflow -Wshift-sign-overflow
+WARNINGS += -Wshift-overflow -Wshift-sign-overflow \
+ -Wlogical-op-parentheses
endif
ifneq (${E},0)
diff --git a/drivers/mentor/i2c/mi2cv.c b/drivers/mentor/i2c/mi2cv.c
index 1cdcf74..b0270c9 100644
--- a/drivers/mentor/i2c/mi2cv.c
+++ b/drivers/mentor/i2c/mi2cv.c
@@ -81,14 +81,14 @@
udelay(1);
}
-static int mentor_i2c_interrupt_get(void)
+static bool mentor_i2c_interrupt_get(void)
{
uint32_t reg;
/* get the interrupt flag bit */
reg = mmio_read_32((uintptr_t)&base->control);
reg &= I2C_CONTROL_IFLG;
- return reg && I2C_CONTROL_IFLG;
+ return (reg != 0U);
}
static int mentor_i2c_wait_interrupt(void)
diff --git a/plat/xilinx/zynqmp/pm_service/pm_api_ioctl.c b/plat/xilinx/zynqmp/pm_service/pm_api_ioctl.c
index 44acb4b..60e80d9 100644
--- a/plat/xilinx/zynqmp/pm_service/pm_api_ioctl.c
+++ b/plat/xilinx/zynqmp/pm_service/pm_api_ioctl.c
@@ -58,7 +58,7 @@
{
unsigned int val;
- if (mmio_read_32(CRL_APB_RST_LPD_TOP) && CRL_APB_RPU_AMBA_RESET)
+ if (mmio_read_32(CRL_APB_RST_LPD_TOP) & CRL_APB_RPU_AMBA_RESET)
return PM_RET_ERROR_ACCESS;
val = mmio_read_32(ZYNQMP_RPU_GLBL_CNTL);