From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932664AbcK1K0c (ORCPT ); Mon, 28 Nov 2016 05:26:32 -0500 Received: from mx2.suse.de ([195.135.220.15]:37114 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932548AbcK1KY4 (ORCPT ); Mon, 28 Nov 2016 05:24:56 -0500 Date: Mon, 28 Nov 2016 11:24:54 +0100 From: Petr Mladek To: Nicolas Iooss Cc: Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] kthread: add __printf attributes Message-ID: <20161128102454.GA21230@pathway.suse.cz> References: <20161126193543.22672-1-nicolas.iooss_linux@m4x.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161126193543.22672-1-nicolas.iooss_linux@m4x.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat 2016-11-26 20:35:43, Nicolas Iooss wrote: > When commit fbae2d44aa1d ("kthread: add kthread_create_worker*()") > introduced some kthread_create_...() functions which were taking > printf-like parametter, it introduced __printf attributes to some > functions (e.g. kthread_create_worker()). Nevertheless some new > functions were forgotten (they have been detected thanks to > -Wmissing-format-attribute warning flag). > > Add the missing __printf attributes to the newly-introduced functions in > order to detect formatting issues at build-time with -Wformat flag. > > Signed-off-by: Nicolas Iooss Thanks for the fix. Reviewed-by: Petr Mladek > --- > include/linux/kthread.h | 2 +- > kernel/kthread.c | 5 +++-- > 2 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/include/linux/kthread.h b/include/linux/kthread.h > index a6e82a69c363..4de93a54f20b 100644 > --- a/include/linux/kthread.h > +++ b/include/linux/kthread.h > @@ -174,7 +174,7 @@ __printf(2, 3) > struct kthread_worker * > kthread_create_worker(unsigned int flags, const char namefmt[], ...); > > -struct kthread_worker * > +__printf(3, 4) struct kthread_worker * > kthread_create_worker_on_cpu(int cpu, unsigned int flags, > const char namefmt[], ...); > > diff --git a/kernel/kthread.c b/kernel/kthread.c > index be2cc1f9dd57..2baf9354c5fc 100644 > --- a/kernel/kthread.c > +++ b/kernel/kthread.c > @@ -244,7 +244,8 @@ static void create_kthread(struct kthread_create_info *create) > } > } > > -static struct task_struct *__kthread_create_on_node(int (*threadfn)(void *data), > +static __printf(4, 0) > +struct task_struct *__kthread_create_on_node(int (*threadfn)(void *data), > void *data, int node, > const char namefmt[], > va_list args) It would be great to update the indentation of these three lines as well. But it is just a cosmetic problem. Best Regards, Petr