From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Thu, 16 Jun 2011 20:06:20 -0400 Subject: [U-Boot] [PATCH V4 1/2] GPIO: Tegra2: add GPIO driver for Tegra2 In-Reply-To: <1308268294-14901-2-git-send-email-twarren@nvidia.com> References: <1308268294-14901-1-git-send-email-twarren@nvidia.com> <1308268294-14901-2-git-send-email-twarren@nvidia.com> Message-ID: <201106162006.22031.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thursday, June 16, 2011 19:51:33 Tom Warren wrote: > +int gpio_request(int gp, const char *label) > +{ > + if (gp >= MAX_NUM_GPIOS) > + return -1; > + > + strncpy(gpio_names[gp].name, label, GPIO_NAME_SIZE); if the label is >=GPIO_NAME_SIZE, the result will not be NUL terminated. i'd suggest you add something like this to after the strncpy call: gpio_names[gp].name[GPIO_NAME_SIZE - 1] = '\0'; > + return (val >> GPIO_BIT(gp)) & 1; could be written as !!(val >> GPIO_BIT(gp)), but up to you, or see how the code size works out otherwise, looks fine. not that i looked too closely as i dont know anything about Tegra2 parts. -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20110616/8fd28e78/attachment.pgp