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>
This commit is contained in:
Patrick Delaunay 2020-02-12 19:37:37 +01:00
parent fdabacecf0
commit df2d1b8fc4

View File

@ -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);