aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-stm32mp
diff options
context:
space:
mode:
authorPatrick Delaunay2020-02-12 19:37:37 +0100
committerPatrick Delaunay2020-03-24 14:05:35 +0100
commitdf2d1b8fc472bd0c7ec20d86337d437241d9b013 (patch)
tree54d953e625ad36cd91ec2eca428582e0c6fb3e6f /arch/arm/mach-stm32mp
parentfdabacecf0af242d92e312faa4df6c24857f8935 (diff)
arm: stm32mp: bsec: remove unneeded test
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 <patrick.delaunay@st.com> Acked-by: Patrice Chotard <patrice.chotard@st.com>
Diffstat (limited to 'arch/arm/mach-stm32mp')
-rw-r--r--arch/arm/mach-stm32mp/bsec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/mach-stm32mp/bsec.c b/arch/arm/mach-stm32mp/bsec.c
index a77c706a1a0..1d904caae11 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);