Staging: vme: devices: Use kasprintf
authorVaishali Thakkar <vthakkar1994@gmail.com>
Thu, 23 Oct 2014 07:57:46 +0000 (13:27 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Oct 2014 02:33:05 +0000 (10:33 +0800)
commite31a0e62803c64cab5e150b94c31364a1ce1d0fd
tree8abf0f73b64e4c88517ab492cbfe23211b89d455
parentd2b778712e3aa5258fabbb96ed05bcb073a1ce2e
Staging: vme: devices: Use kasprintf

This patch uses kasprintf which combines kmalloc and sprintf.
kasprintf also takes care of the size calculation.

This is done using Coccinelle. Semantic patch used is as follows:

@@
expression a,flag;
expression list args;
statement S;
@@

 a =
- \(kmalloc\|kzalloc\)(...,flag)
+ kasprintf (flag,args)
  <... when != a
  if (a == NULL || ...) S
  ...>
- sprintf(a,args);

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vme/devices/vme_pio2_gpio.c
This page took 0.043596 seconds and 5 git commands to generate.