Skip to content
Snippets Groups Projects
Forked from Reform / reform-boundary-uboot
Source project has a limited visibility.
  • Marek Vasut's avatar
    cd3c5896
    imx: i2c: Zap unnecessary malloc() calls · cd3c5896
    Marek Vasut authored
    
    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: default avatarMarek 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: default avatarChristian Gmeiner <christian.gmeiner@gmail.com>
    cd3c5896
    History
    imx: i2c: Zap unnecessary malloc() calls
    Marek Vasut authored
    
    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: default avatarMarek 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: default avatarChristian Gmeiner <christian.gmeiner@gmail.com>