Merge tag 'topic/core-stuff-2014-08-15' of git://anongit.freedesktop.org/drm-intel...
[firefly-linux-kernel-4.4.55.git] / fs / adfs / dir_fplus.c
index d9e3bee4e653ff2c6df48006ddcdb3119082233a..f2ba88ab4aed0e1e7baf934b95a6b9612e57baa4 100644 (file)
@@ -55,10 +55,10 @@ adfs_fplus_read(struct super_block *sb, unsigned int id, unsigned int sz, struct
        }
 
        size >>= sb->s_blocksize_bits;
-       if (size > sizeof(dir->bh)/sizeof(dir->bh[0])) {
+       if (size > ARRAY_SIZE(dir->bh)) {
                /* this directory is too big for fixed bh set, must allocate */
                struct buffer_head **bh_fplus =
-                       kzalloc(size * sizeof(struct buffer_head *),
+                       kcalloc(size, sizeof(struct buffer_head *),
                                GFP_KERNEL);
                if (!bh_fplus) {
                        adfs_error(sb, "not enough memory for"
@@ -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;
                }