From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mateusz Kulikowski Date: Mon, 18 Apr 2016 22:23:24 +0200 Subject: [U-Boot] [PATCH 2/3] drivers/gpio/pm8916_gpio.c: Make pid be uint32_t In-Reply-To: <1460488284-26713-2-git-send-email-trini@konsulko.com> References: <1460488284-26713-1-git-send-email-trini@konsulko.com> <1460488284-26713-2-git-send-email-trini@konsulko.com> Message-ID: <5715423C.9060700@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 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 > 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? Regards, Mateusz -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXFUIWAAoJELvtohmVtQzBow8H/i4ojMv7MM+4YdHZs/Tf1gdy LWh68je+eGX+Nt1pwVXdgh52NJ6/PFJvUstlHaPKpPhlCAfOEEno6aI05dp0UQ5E VG5bqyL1k1IoqDue+3xoL2tJ0IZvBTKDpeqw8rVDH5PEFp5/aXs9FKwZm9VcVpny +3fi0sxFACAOs+PjMPqP9meXVTZyRRCTh/dAeH4bwLRGp249Tgq50vMajYjq1CW5 SM5TGFKeUgs17xVs163INW5s6UnNmqjj+gmVr7HRDH2uDWoQ6P77U9Z+l4yvSb72 Fw/vi6pqnxWsj6DCBEBkZ+jY2SVGB4LXm3bhQH2FO6ljXAW7KYamt1w4DoD9ABU= =bczK -----END PGP SIGNATURE-----