Creating predefined _COMM keywords in kmsg log dict has unnecessary
copy for task comm, to avoid build issue, in the commit
b621c1cdcea7
("kmsg: Use TASK_COMM_LEN size buffer for get_task_comm()").
Remove the unnecessary string copy from creating predefined kmsg
log dict.
Change-Id: I7547487497e7f3acdab452586f97cf947fc1e6db
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
static size_t set_kmsg_dict(char *buf)
{
size_t len;
- char task_comm[TASK_COMM_LEN];
len = sprintf(buf, "_PID=%d", task_tgid_nr(current)) + 1;
len += sprintf(buf + len, "_TID=%d", task_pid_nr(current)) + 1;
memcpy(buf + len, "_COMM=", 6);
len += 6;
- get_task_comm(task_comm, current);
- strcpy(buf + len, task_comm);
+ __get_task_comm(buf + len, KMSG_DICT_MAX_LEN - len, current);
while (buf[len] != '\0')
len++;
return len;