adfs: add __printf verification, fix format/argument mismatches
authorJoe Perches <joe@perches.com>
Fri, 8 Aug 2014 21:22:26 +0000 (14:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 8 Aug 2014 22:57:24 +0000 (15:57 -0700)
Might as well do the right thing.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/adfs/adfs.h
fs/adfs/dir.c
fs/adfs/dir_fplus.c

index c770337c4b458beefc707a91fb8c9f7315d0634b..24575d9d882d99e790f97d351ddfac369c616603 100644 (file)
@@ -153,6 +153,7 @@ extern int adfs_map_lookup(struct super_block *sb, unsigned int frag_id, unsigne
 extern unsigned int adfs_map_free(struct super_block *sb);
 
 /* Misc */
+__printf(3, 4)
 void __adfs_error(struct super_block *sb, const char *function,
                  const char *fmt, ...);
 #define adfs_error(sb, fmt...) __adfs_error(sb, __func__, fmt)
index 0d138c0de293ed3512046058b5ff96cac8c744ad..51c279a29845e6870125469b18fd06ccdd99f64f 100644 (file)
@@ -138,7 +138,7 @@ adfs_dir_lookup_byname(struct inode *inode, struct qstr *name, struct object_inf
                goto out;
 
        if (ADFS_I(inode)->parent_id != dir.parent_id) {
-               adfs_error(sb, "parent directory changed under me! (%lx but got %lx)\n",
+               adfs_error(sb, "parent directory changed under me! (%lx but got %x)\n",
                           ADFS_I(inode)->parent_id, dir.parent_id);
                ret = -EIO;
                goto free_out;
index c52f1ce15f1eebf5048bff266e21e2b132089019..f2ba88ab4aed0e1e7baf934b95a6b9612e57baa4 100644 (file)
@@ -79,9 +79,8 @@ adfs_fplus_read(struct super_block *sb, unsigned int id, unsigned int sz, struct
 
                dir->bh_fplus[blk] = sb_bread(sb, block);
                if (!dir->bh_fplus[blk]) {
-                       adfs_error(sb,  "dir object %X failed read for"
-                                       " offset %d, mapped block %X",
-                                       id, blk, block);
+                       adfs_error(sb,  "dir object %x failed read for offset %d, mapped block %lX",
+                                  id, blk, block);
                        goto out;
                }