* [U-Boot] [PATCH] pfuze: Fix unsigned variable for less-than-zero comparison
@ 2016-01-04 7:26 Peng Fan
2016-01-04 9:07 ` Stefano Babic
2016-01-07 16:49 ` Stefano Babic
0 siblings, 2 replies; 4+ messages in thread
From: Peng Fan @ 2016-01-04 7:26 UTC (permalink / raw)
To: u-boot
From: "Ye.Li" <B37916@freescale.com>
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 <B37916@freescale.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Stefano Babic <sbabic@denx.de>
---
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;
--
2.6.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] pfuze: Fix unsigned variable for less-than-zero comparison
2016-01-04 9:07 ` Stefano Babic
@ 2016-01-04 8:57 ` Peng Fan
0 siblings, 0 replies; 4+ messages in thread
From: Peng Fan @ 2016-01-04 8:57 UTC (permalink / raw)
To: u-boot
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" <B37916@freescale.com>
>>
>
>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 <B37916@freescale.com>
>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>> Cc: Przemyslaw Marczak <p.marczak@samsung.com>
>> Cc: Stefano Babic <sbabic@denx.de>
>> ---
>> 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 <sbabic@denx.de>
>
>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
>=====================================================================
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] pfuze: Fix unsigned variable for less-than-zero comparison
2016-01-04 7:26 [U-Boot] [PATCH] pfuze: Fix unsigned variable for less-than-zero comparison Peng Fan
@ 2016-01-04 9:07 ` Stefano Babic
2016-01-04 8:57 ` Peng Fan
2016-01-07 16:49 ` Stefano Babic
1 sibling, 1 reply; 4+ messages in thread
From: Stefano Babic @ 2016-01-04 9:07 UTC (permalink / raw)
To: u-boot
Hi Peng,
On 04/01/2016 08:26, Peng Fan wrote:
> From: "Ye.Li" <B37916@freescale.com>
>
it is enough to have Ye in the Signed-off instead of the commit message.
> 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 <B37916@freescale.com>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> Cc: Przemyslaw Marczak <p.marczak@samsung.com>
> Cc: Stefano Babic <sbabic@denx.de>
> ---
> 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 <sbabic@denx.de>
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
=====================================================================
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] pfuze: Fix unsigned variable for less-than-zero comparison
2016-01-04 7:26 [U-Boot] [PATCH] pfuze: Fix unsigned variable for less-than-zero comparison Peng Fan
2016-01-04 9:07 ` Stefano Babic
@ 2016-01-07 16:49 ` Stefano Babic
1 sibling, 0 replies; 4+ messages in thread
From: Stefano Babic @ 2016-01-07 16:49 UTC (permalink / raw)
To: u-boot
On 04/01/2016 08:26, Peng Fan wrote:
> From: "Ye.Li" <B37916@freescale.com>
>
> 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 <B37916@freescale.com>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> Cc: Przemyslaw Marczak <p.marczak@samsung.com>
> Cc: Stefano Babic <sbabic@denx.de>
> ---
> 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;
>
Applied (fix) to u-boot-imx, thanks !
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
=====================================================================
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-01-07 16:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-04 7:26 [U-Boot] [PATCH] pfuze: Fix unsigned variable for less-than-zero comparison Peng Fan
2016-01-04 9:07 ` Stefano Babic
2016-01-04 8:57 ` Peng Fan
2016-01-07 16:49 ` Stefano Babic
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox