lkml.org 
[lkml]   [2018]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] backing: silence compiler warning using __printf
On Fri 06-04-18 22:14:51, Mathieu Malaterre wrote:
> __printf marker was added in commit d2cc4dde9206 ("bdi_register: add
> __printf verification, fix arg mismatch") for function `bdi_register`
> since it is useful to verify format and arguments. Apply equivalent gcc
> attribute to `bdi_register_va`.
>
> Remove warning triggered with W=1:
>
> mm/backing-dev.c:881:2: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
>
> Signed-off-by: Mathieu Malaterre <malat@debian.org>
> ---
> include/linux/backing-dev.h | 1 +
> 1 file changed, 1 insertion(+)

Yeah, the patch looks good. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

Honza

>
> diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
> index 3e4ce54d84ab..0e9c0f71f726 100644
> --- a/include/linux/backing-dev.h
> +++ b/include/linux/backing-dev.h
> @@ -28,6 +28,7 @@ void bdi_put(struct backing_dev_info *bdi);
>
> __printf(2, 3)
> int bdi_register(struct backing_dev_info *bdi, const char *fmt, ...);
> +__printf(2, 0)
> int bdi_register_va(struct backing_dev_info *bdi, const char *fmt,
> va_list args);
> int bdi_register_owner(struct backing_dev_info *bdi, struct device *owner);
> --
> 2.11.0
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR

\
 
 \ /
  Last update: 2018-04-09 17:50    [W:0.084 / U:5.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site