bdi_register: add __printf verification, fix arg mismatch
authorJoe Perches <joe@perches.com>
Thu, 29 Nov 2012 14:37:03 +0000 (08:37 -0600)
committerAlex Elder <elder@inktank.com>
Thu, 13 Dec 2012 14:13:07 +0000 (08:13 -0600)
__printf is useful to verify format and arguments.

Signed-off-by: Joe Perches <joe@perches.com>
Reviewed-by: Alex Elder <elder@inktank.com>
fs/ceph/super.c
include/linux/backing-dev.h

index fcda1c73a1e5baaac8e27d1561f93e3d014c3dfa..1a144001b2e1eab74b8cde4c00c0fedb2d9aeec9 100644 (file)
@@ -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;
index 2a9a9abc91260c09a7940136a965a08209c5828b..12731a19ef060792b5500c3731551b636c437fe8 100644 (file)
@@ -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);