]> git.sur5r.net Git - u-boot/commit
imx: i2c: Zap unnecessary malloc() calls
authorMarek Vasut <marex@denx.de>
Tue, 16 Dec 2014 13:09:16 +0000 (14:09 +0100)
committerStefano Babic <sbabic@denx.de>
Tue, 30 Dec 2014 13:05:48 +0000 (14:05 +0100)
commitcd3c5896b6582e73cf6a6d48c7ecc29924fa3089
treeb68a3f37d7796415756c0abfe8e9597f8dda7c23
parentc86efd85e99464f5dfe69b6477f9b0dfd7691063
imx: i2c: Zap unnecessary malloc() calls

The malloc() calls are unnecessary, just allocate the stuff on stack.
While at it, reorder the code a little, so that only one variable is
used for the text, use snprintf() instead of sprintf() and use %01d
as a formatting string to avoid any possible overflows.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Igor Grinberg <grinberg@compulab.co.il>
Cc: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Sean Cross <xobs@kosagi.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
arch/arm/imx-common/i2c-mxv7.c