From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Cochran Subject: Re: [PATCH] ptp: drop redundant kasprintf() to create worker name Date: Sat, 27 Oct 2018 06:04:45 -0700 Message-ID: <20181027130445.5xgwclfryst3pcia@localhost> References: <20181026212300.5827-1-linux@rasmusvillemoes.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Kees Cook , netdev@vger.kernel.org, linux-kernel@vger.kernel.org To: Rasmus Villemoes Return-path: Content-Disposition: inline In-Reply-To: <20181026212300.5827-1-linux@rasmusvillemoes.dk> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Fri, Oct 26, 2018 at 11:22:59PM +0200, Rasmus Villemoes wrote: > 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. Acked-by: Richard Cochran