Skip to content

Commit

Permalink
backing: silence compiler warning using __printf
Browse files Browse the repository at this point in the history
__printf marker was added in commit d2cc4dd ("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]

Reviewed-by: Jan Kara <[email protected]>
Signed-off-by: Mathieu Malaterre <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
malaterre authored and axboe committed Apr 10, 2018
1 parent 37c7c6c commit a93f00b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/linux/backing-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a93f00b

Please sign in to comment.