]> Git Repo - linux.git/commit
arch/x86/pci: use kasprintf
authorJulia Lawall <[email protected]>
Mon, 24 May 2010 19:13:16 +0000 (12:13 -0700)
committerH. Peter Anvin <[email protected]>
Mon, 24 May 2010 20:31:45 +0000 (13:31 -0700)
commitb46fc5f235be04a7f77fb2af1d8cb809889c25c1
tree0bd2e23d52a914a8d79ccc8dd772963ec519f42c
parent8c3ba8d049247dc06b6dcee1711a11b26647aa44
arch/x86/pci: use kasprintf

kasprintf combines kmalloc and sprintf, and takes care of the size
calculation itself.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression a,flag;
expression list args;
statement S;
@@

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

Signed-off-by: Julia Lawall <[email protected]>
LKML-Reference: <201005241913[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: H. Peter Anvin <[email protected]>
arch/x86/pci/acpi.c
This page took 0.049036 seconds and 4 git commands to generate.