Commit c0b942a7 authored by Nicolas Iooss's avatar Nicolas Iooss Committed by Linus Torvalds

kthread: add __printf attributes

When commit fbae2d44 ("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.

Link: http://lkml.kernel.org/r/20161126193543.22672-1-nicolas.iooss_linux@m4x.orgSigned-off-by: default avatarNicolas Iooss <nicolas.iooss_linux@m4x.org>
Reviewed-by: default avatarPetr Mladek <pmladek@suse.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent df5f0f0a
...@@ -175,7 +175,7 @@ __printf(2, 3) ...@@ -175,7 +175,7 @@ __printf(2, 3)
struct kthread_worker * struct kthread_worker *
kthread_create_worker(unsigned int flags, const char namefmt[], ...); 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, kthread_create_worker_on_cpu(int cpu, unsigned int flags,
const char namefmt[], ...); const char namefmt[], ...);
......
...@@ -261,7 +261,8 @@ static void create_kthread(struct kthread_create_info *create) ...@@ -261,7 +261,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, void *data, int node,
const char namefmt[], const char namefmt[],
va_list args) va_list args)
...@@ -635,7 +636,7 @@ int kthread_worker_fn(void *worker_ptr) ...@@ -635,7 +636,7 @@ int kthread_worker_fn(void *worker_ptr)
} }
EXPORT_SYMBOL_GPL(kthread_worker_fn); EXPORT_SYMBOL_GPL(kthread_worker_fn);
static struct kthread_worker * static __printf(3, 0) struct kthread_worker *
__kthread_create_worker(int cpu, unsigned int flags, __kthread_create_worker(int cpu, unsigned int flags,
const char namefmt[], va_list args) const char namefmt[], va_list args)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment