linux/drivers/ptp
Rasmus Villemoes 822c5f7341 ptp: drop redundant kasprintf() to create worker name
Building with -Wformat-nonliteral, gcc complains

drivers/ptp/ptp_clock.c: In function ‘ptp_clock_register’:
drivers/ptp/ptp_clock.c:239:26: warning: format not a string literal and no format arguments [-Wformat-nonliteral]
            worker_name : info->name);

kthread_create_worker takes fmt+varargs to set the name of the
worker, and that happens with a vsnprintf() to a stack buffer (that is
then copied into task_comm). So there's no reason not to just pass
"ptp%d", ptp->index to kthread_create_worker() and avoid the
intermediate worker_name variable.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-10-28 19:20:06 -07:00
..
Kconfig ptp: support DPAA FMan 1588 timer in ptp_qoriq 2018-06-26 22:15:14 +09:00
Makefile ptp: rework gianfar_ptp as QorIQ common PTP driver 2018-05-28 23:05:11 -04:00
ptp_chardev.c ptp: fix Spectre v1 vulnerability 2018-10-17 22:00:22 -07:00
ptp_clock.c ptp: drop redundant kasprintf() to create worker name 2018-10-28 19:20:06 -07:00
ptp_dte.c ptp: ptp_dte: simplify getting .driver_data 2018-10-22 19:48:35 -07:00
ptp_ixp46x.c
ptp_kvm.c
ptp_pch.c ptp_pch: use helpers function for converting between ns and timespec 2018-04-27 15:22:28 -04:00
ptp_private.h
ptp_qoriq.c ptp_qoriq: use div_u64/div_u64_rem for 64-bit division 2018-08-06 10:43:35 -07:00
ptp_sysfs.c