From patchwork Wed Feb 12 18:37:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 236275 List-Id: U-Boot discussion From: patrick.delaunay at st.com (Patrick Delaunay) Date: Wed, 12 Feb 2020 19:37:37 +0100 Subject: [PATCH 03/10] arm: stm32mp: bsec: remove unneeded test In-Reply-To: <20200212183744.5309-1-patrick.delaunay@st.com> References: <20200212183744.5309-1-patrick.delaunay@st.com> Message-ID: <20200212183744.5309-4-patrick.delaunay@st.com> Remove the test offs < 0 , as offs is unsigned. This patch solves the warnings when compiling with W=1 on stm32mp1 board: In function ?stm32mp_bsec_read?: arch/arm/mach-stm32mp/bsec.c:368:11: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 368 | if (offs < 0 || (offs % 4) || (size % 4)) | ^ In function ?stm32mp_bsec_write?: arch/arm/mach-stm32mp/bsec.c:405:11: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 405 | if (offs < 0 || (offs % 4) || (size % 4)) | ^ Signed-off-by: Patrick Delaunay Acked-by: Patrice Chotard --- arch/arm/mach-stm32mp/bsec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-stm32mp/bsec.c b/arch/arm/mach-stm32mp/bsec.c index a77c706a1a..1d904caae1 100644 --- a/arch/arm/mach-stm32mp/bsec.c +++ b/arch/arm/mach-stm32mp/bsec.c @@ -365,7 +365,7 @@ static int stm32mp_bsec_read(struct udevice *dev, int offset, shadow = false; } - if (offs < 0 || (offs % 4) || (size % 4)) + if ((offs % 4) || (size % 4)) return -EINVAL; otp = offs / sizeof(u32); @@ -402,7 +402,7 @@ static int stm32mp_bsec_write(struct udevice *dev, int offset, shadow = false; } - if (offs < 0 || (offs % 4) || (size % 4)) + if ((offs % 4) || (size % 4)) return -EINVAL; otp = offs / sizeof(u32);