From: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] drivers/gpio/pm8916_gpio.c: Make pid be uint32_t
Date: Mon, 18 Apr 2016 22:24:20 +0200 [thread overview]
Message-ID: <57154274.9020705@gmail.com> (raw)
In-Reply-To: <5715423C.9060700@gmail.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 18.04.2016 22:23, Mateusz Kulikowski wrote:
> Hi,
>
> Sorry for slow reply.
>
> On 12.04.2016 21:11, Tom Rini wrote:
>> If get_dev_addr fails it will return FDT_ADDR_T_NONE and:
>>>>> "priv->pid == 4294967295U" is always false regardless of the values of its operands. This occurs as the logical operand of if.
>
>> Cc: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
>> Reported-by: Coverity (CID: 143913)
> [...]
>
>> - uint16_t pid; /* Peripheral ID on SPMI bus */
>> + uint32_t pid; /* Peripheral ID on SPMI bus */
>> };
>
>> static int pm8916_gpio_set_direction(struct udevice *dev, unsigned offset,
>
>
> Note applies to two patches in this series (pm8916_gpio.c and pm8916.c)
>
> I think (now, when the coverity pointed out mistake) that we should add
> in that case check if pid fits in 16-bits, as this is maximum pid value on spmi bus.
>
> This checks should be done in pm8916_gpio_probe() and pm8916_probe().
>
> Would you like to do it in your series or want me to post another patch on top of them?
Or even better - leave it as uint16_t and do check & cast in probe()
Matuesz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBCAAGBQJXFUJtAAoJELvtohmVtQzBblgH/ROdYlG668Kz8ak/sUo/xksn
NFeWMDC8pORbCOLhPnHcEJhAPzx+a0c5pUWUvsloTnj8t08rM+pcmnVV+jW4DhAC
TxUgXYKjXMzbNlYYGn4cfb1Qlyss0+/xkv3C33LwI4hQYmE46RtThYtZqt6Uk+lk
9/eGCHt+H1tbKoD1BZIbzUwoDMTGlv7FgpzsH0/iW1QsDhbfUc27jkZNUvDgZO3Y
ElX9I9cSFD5oqSVO3X+iDtGXaD6UEOGU+nb42wkTc9gyg9qunS9TV2kJsrrJu2DD
Le4mN8NevrxyYbRZZM7EThkBD7skHr8wKUm6ccoQZLuMK+ZaYaukGirYTFSBQS0=
=MwzG
-----END PGP SIGNATURE-----
next prev parent reply other threads:[~2016-04-18 20:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-12 19:11 [U-Boot] [PATCH 1/3] drivers/tpm/tpm_tis_sandbox.c: Fix uninitialized variable use Tom Rini
2016-04-12 19:11 ` [U-Boot] [PATCH 2/3] drivers/gpio/pm8916_gpio.c: Make pid be uint32_t Tom Rini
2016-04-18 20:23 ` Mateusz Kulikowski
2016-04-18 20:24 ` Mateusz Kulikowski [this message]
2016-04-20 21:26 ` Tom Rini
2016-04-20 21:25 ` Tom Rini
2016-04-22 14:12 ` Mateusz Kulikowski
2016-04-21 11:23 ` [U-Boot] [U-Boot, " Tom Rini
2016-04-12 19:11 ` [U-Boot] [PATCH 3/3] drivers/power/pmic/pm8916.c: Make usid " Tom Rini
2016-04-21 11:23 ` [U-Boot] [U-Boot, " Tom Rini
2016-04-15 14:12 ` [U-Boot] [PATCH 1/3] drivers/tpm/tpm_tis_sandbox.c: Fix uninitialized variable use Simon Glass
2016-04-15 15:44 ` Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57154274.9020705@gmail.com \
--to=mateusz.kulikowski@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.