Skip to content

Commit

Permalink
bdi_register: add __printf verification, fix arg mismatch
Browse files Browse the repository at this point in the history
__printf is useful to verify format and arguments.

Signed-off-by: Joe Perches <[email protected]>
Reviewed-by: Alex Elder <[email protected]>
  • Loading branch information
JoePerches authored and Alex Elder committed Dec 13, 2012
1 parent 83aff95 commit d2cc4dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ceph/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ static int ceph_register_bdi(struct super_block *sb,
fsc->backing_dev_info.ra_pages =
default_backing_dev_info.ra_pages;

err = bdi_register(&fsc->backing_dev_info, NULL, "ceph-%d",
err = bdi_register(&fsc->backing_dev_info, NULL, "ceph-%ld",
atomic_long_inc_return(&bdi_seq));
if (!err)
sb->s_bdi = &fsc->backing_dev_info;
Expand Down
1 change: 1 addition & 0 deletions include/linux/backing-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ struct backing_dev_info {
int bdi_init(struct backing_dev_info *bdi);
void bdi_destroy(struct backing_dev_info *bdi);

__printf(3, 4)
int bdi_register(struct backing_dev_info *bdi, struct device *parent,
const char *fmt, ...);
int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev);
Expand Down

0 comments on commit d2cc4dd

Please sign in to comment.