提交 85b7a9de 编写于 作者: T Tina Johnson 提交者: Greg Kroah-Hartman

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: NTina Johnson <tinajohnson.1234@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 fe6e0197
...@@ -347,7 +347,7 @@ static int init_libcfs_module(void) ...@@ -347,7 +347,7 @@ static int init_libcfs_module(void)
rc = libcfs_debug_init(5 * 1024 * 1024); rc = libcfs_debug_init(5 * 1024 * 1024);
if (rc < 0) { if (rc < 0) {
printk(KERN_ERR "LustreError: libcfs_debug_init: %d\n", rc); pr_err("LustreError: libcfs_debug_init: %d\n", rc);
return rc; return rc;
} }
...@@ -433,8 +433,7 @@ static void exit_libcfs_module(void) ...@@ -433,8 +433,7 @@ static void exit_libcfs_module(void)
rc = libcfs_debug_cleanup(); rc = libcfs_debug_cleanup();
if (rc) if (rc)
printk(KERN_ERR "LustreError: libcfs_debug_cleanup: %d\n", pr_err("LustreError: libcfs_debug_cleanup: %d\n", rc);
rc);
libcfs_arch_cleanup(); libcfs_arch_cleanup();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册