[PATCH 2/2] drivers: android: Fix logtags in methods

From: Harsh Shandilya
Date: Fri Dec 22 2017 - 09:08:15 EST


From: Harsh Shandilya <harsh@xxxxxxxx>

Several methods in the driver were hardcoding
the function name in their logging calls which
is a checkpatch violation. Utilise the __func__
macro to avoid needing to add the function name
as is to the string.

Test: logtags in dmesg remain unaffected before
and after the patch.

Signed-off-by: Harsh Shandilya <harsh@xxxxxxxx>

Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Cc: "Arve HjÃnnevÃg" <arve@xxxxxxxxxxx>
Cc: Todd Kjos <tkjos@xxxxxxxxxxx>
Cc: Martijn Coenen <maco@xxxxxxxxxxx>
Cc: devel@xxxxxxxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
---
drivers/android/binder.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index ffb31dd9191a..1e48acfe27b7 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -4467,8 +4467,8 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
unsigned int size = _IOC_SIZE(cmd);
void __user *ubuf = (void __user *)arg;

- /*pr_info("binder_ioctl: %d:%d %x %lx\n",
- proc->pid, current->pid, cmd, arg);*/
+ // pr_info("%s: %d:%d %x %lx\n",
+ // __func__, proc->pid, current->pid, cmd, arg);

binder_selftest_alloc(&proc->alloc);

@@ -4631,8 +4631,9 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma)
return 0;

err_bad_arg:
- pr_err("binder_mmap: %d %lx-%lx %s failed %d\n",
- proc->pid, vma->vm_start, vma->vm_end, failure_string, ret);
+ pr_err("%s: %d %lx-%lx %s failed %d\n",
+ __func__, proc->pid, vma->vm_start, vma->vm_end,
+ failure_string, ret);
return ret;
}

@@ -4641,8 +4642,8 @@ static int binder_open(struct inode *nodp, struct file *filp)
struct binder_proc *proc;
struct binder_device *binder_dev;

- binder_debug(BINDER_DEBUG_OPEN_CLOSE, "binder_open: %d:%d\n",
- current->group_leader->pid, current->pid);
+ binder_debug(BINDER_DEBUG_OPEN_CLOSE, "%s: %d:%d\n",
+ __func__, current->group_leader->pid, current->pid);

proc = kzalloc(sizeof(*proc), GFP_KERNEL);
if (proc == NULL)
--
2.15.0.631.g7ddcec0