From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peng Fan Date: Mon, 4 Jan 2016 16:57:58 +0800 Subject: [U-Boot] [PATCH] pfuze: Fix unsigned variable for less-than-zero comparison In-Reply-To: <568A364D.3030406@denx.de> References: <1451892390-4754-1-git-send-email-peng.fan@nxp.com> <568A364D.3030406@denx.de> Message-ID: <20160104085756.GA11833@linux-7smt.suse> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Stefano, On Mon, Jan 04, 2016 at 10:07:25AM +0100, Stefano Babic wrote: >Hi Peng, > >On 04/01/2016 08:26, Peng Fan wrote: >> From: "Ye.Li" >> > >it is enough to have Ye in the Signed-off instead of the commit message. Since author is not me, but patch sent out from me. I think git add that automatically. "git am" will not add this in commit message. Regards, Peng. > >> According to the Coverity result, a unsigned int variable is used fo less- >> than-zero comparison, the result is never true. Need to fix the variable >> type to signed int. >> >> Signed-off-by: Ye.Li >> Signed-off-by: Peng Fan >> Cc: Przemyslaw Marczak >> Cc: Stefano Babic >> --- >> board/freescale/common/pfuze.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/board/freescale/common/pfuze.c b/board/freescale/common/pfuze.c >> index 783c46d..69afa83 100644 >> --- a/board/freescale/common/pfuze.c >> +++ b/board/freescale/common/pfuze.c >> @@ -13,7 +13,8 @@ >> int pfuze_mode_init(struct pmic *p, u32 mode) >> { >> unsigned char offset, i, switch_num; >> - u32 id, ret; >> + u32 id; >> + int ret; >> >> pmic_reg_read(p, PFUZE100_DEVICEID, &id); >> id = id & 0xf; >> > >Apart of that: > >Reviewed-by: Stefano Babic > >Best regards, >Stefano Babic > > >-- >===================================================================== >DENX Software Engineering GmbH, Managing Director: Wolfgang Denk >HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany >Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de >=====================================================================