From: Marek Vasut Date: Thu, 24 Apr 2014 18:05:20 +0000 (+0200) Subject: crypto: caam - Kill SPRINTFCAT() with fire X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e22cdcfa13d9799ea46245946ae09b4a328ff27d;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git crypto: caam - Kill SPRINTFCAT() with fire This macro is just like an encyclopedia of string handling done wrong. This must die. This is so wrong on so many levels. Signed-off-by: Marek Vasut Cc: Herbert Xu Cc: Horia Geanta Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c index 66a7461cf9ae..7ed2e4fb3c15 100644 --- a/drivers/crypto/caam/error.c +++ b/drivers/crypto/caam/error.c @@ -158,16 +158,6 @@ static const char * const rng_err_id_list[] = { "Secure key generation", }; -#define SPRINTFCAT(str, format, param, max_alloc) \ -{ \ - char *tmp; \ - \ - tmp = kmalloc(sizeof(format) + max_alloc, GFP_ATOMIC); \ - sprintf(tmp, format, param); \ - strcat(str, tmp); \ - kfree(tmp); \ -} - static void report_ccb_status(struct device *jrdev, u32 status, const char *error, char *__outstr) {