[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20181028.192025.548283670318508626.davem@davemloft.net>
Date: Sun, 28 Oct 2018 19:20:25 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: linux@...musvillemoes.dk
Cc: richardcochran@...il.com, keescook@...omium.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ptp: drop redundant kasprintf() to create worker name
From: Rasmus Villemoes <linux@...musvillemoes.dk>
Date: Fri, 26 Oct 2018 23:22:59 +0200
> 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@...musvillemoes.dk>
Applied.
Powered by blists - more mailing lists