OSDN Git Service

staging: lustre: lustre: libcfs: Replaced printk() with pr_err()
authorTina Johnson <tinajohnson.1234@gmail.com>
Mon, 2 Mar 2015 18:10:25 +0000 (23:40 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Mar 2015 17:54:32 +0000 (09:54 -0800)
commit85b7a9de00bde29e3c815474f51bfdf0fbcde9d7
tree7e44ddd2f44dfbe3af3a0ff4ec380fa538096361
parentfe6e0197ba7a5820419e68cff3879786388e8971
staging: lustre: lustre: libcfs: Replaced printk() with pr_err()

The following checkpatch warning was fixed:

Prefer [subsystem eg: netdev]_err([subsystem]dev

with the help of Coccinelle. The following semantic patch was used:

@a@
expression e;
@@

printk(e,...);

@script:python b@
e << a.e;
y;
@@

import re
match = re.match('KERN_ERR ', e);
if (match == None):
    cocci.include_match(False)

else:
    m = re.sub('KERN_ERR ', '', e)
    coccinelle.y = m;

@c@
expression a.e;
identifier b.y;
@@

- printk(e,
+ pr_err(y,
  ...);

Signed-off-by: Tina Johnson <tinajohnson.1234@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/libcfs/module.c