mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-05 04:36:13 +02:00
stm32mp1: bsec: Fix warnings when compiling with W=1
This patch solves the following warnings:
arch/arm/mach-stm32mp/bsec.c: In function 'stm32mp_bsec_read':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (offset >= STM32_BSEC_OTP_OFFSET) {
^~
arch/arm/mach-stm32mp/bsec.c: In function 'stm32mp_bsec_write':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (offset >= STM32_BSEC_OTP_OFFSET) {
^~
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
This commit is contained in:
parent
0e9fb25f71
commit
745b676d00
@ -358,12 +358,13 @@ static int stm32mp_bsec_read(struct udevice *dev, int offset,
|
||||
bool shadow = true;
|
||||
int nb_otp = size / sizeof(u32);
|
||||
int otp;
|
||||
unsigned int offs = offset;
|
||||
|
||||
if (offset >= STM32_BSEC_OTP_OFFSET) {
|
||||
offset -= STM32_BSEC_OTP_OFFSET;
|
||||
if (offs >= STM32_BSEC_OTP_OFFSET) {
|
||||
offs -= STM32_BSEC_OTP_OFFSET;
|
||||
shadow = false;
|
||||
}
|
||||
otp = offset / sizeof(u32);
|
||||
otp = offs / sizeof(u32);
|
||||
|
||||
if (otp < 0 || (otp + nb_otp - 1) > BSEC_OTP_MAX_VALUE) {
|
||||
dev_err(dev, "wrong value for otp, max value : %i\n",
|
||||
@ -393,12 +394,13 @@ static int stm32mp_bsec_write(struct udevice *dev, int offset,
|
||||
bool shadow = true;
|
||||
int nb_otp = size / sizeof(u32);
|
||||
int otp;
|
||||
unsigned int offs = offset;
|
||||
|
||||
if (offset >= STM32_BSEC_OTP_OFFSET) {
|
||||
offset -= STM32_BSEC_OTP_OFFSET;
|
||||
if (offs >= STM32_BSEC_OTP_OFFSET) {
|
||||
offs -= STM32_BSEC_OTP_OFFSET;
|
||||
shadow = false;
|
||||
}
|
||||
otp = offset / sizeof(u32);
|
||||
otp = offs / sizeof(u32);
|
||||
|
||||
if (otp < 0 || (otp + nb_otp - 1) > BSEC_OTP_MAX_VALUE) {
|
||||
dev_err(dev, "wrong value for otp, max value : %d\n",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user