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>
rc = libcfs_debug_init(5 * 1024 * 1024);
if (rc < 0) {
- printk(KERN_ERR "LustreError: libcfs_debug_init: %d\n", rc);
+ pr_err("LustreError: libcfs_debug_init: %d\n", rc);
return rc;
}
rc = libcfs_debug_cleanup();
if (rc)
- printk(KERN_ERR "LustreError: libcfs_debug_cleanup: %d\n",
- rc);
+ pr_err("LustreError: libcfs_debug_cleanup: %d\n", rc);
libcfs_arch_cleanup();
}