Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
[firefly-linux-kernel-4.4.55.git] / drivers / mtd / mtdswap.c
index 8b33b26eb12b25a1dccc1f4b42a7f8992b2229de..fc8b3d16cce7ec83dddf9a5d4f8bee860a6f6b66 100644 (file)
@@ -145,7 +145,7 @@ struct mtdswap_dev {
 struct mtdswap_oobdata {
        __le16 magic;
        __le32 count;
-} __attribute__((packed));
+} __packed;
 
 #define MTDSWAP_MAGIC_CLEAN    0x2095
 #define MTDSWAP_MAGIC_DIRTY    (MTDSWAP_MAGIC_CLEAN + 1)
@@ -1287,7 +1287,7 @@ static int mtdswap_show(struct seq_file *s, void *data)
 
        seq_printf(s, "total erasures: %lu\n", sum);
 
-       seq_printf(s, "\n");
+       seq_puts(s, "\n");
 
        seq_printf(s, "mtdswap_readsect count: %llu\n", d->sect_read_count);
        seq_printf(s, "mtdswap_writesect count: %llu\n", d->sect_write_count);
@@ -1296,7 +1296,7 @@ static int mtdswap_show(struct seq_file *s, void *data)
        seq_printf(s, "mtd write count: %llu\n", d->mtd_write_count);
        seq_printf(s, "discarded pages count: %llu\n", d->discard_page_count);
 
-       seq_printf(s, "\n");
+       seq_puts(s, "\n");
        seq_printf(s, "total pages: %u\n", pages);
        seq_printf(s, "pages mapped: %u\n", mapped);
 
@@ -1474,7 +1474,7 @@ static void mtdswap_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
        }
 
        eblocks = mtd_div_by_eb(use_size, mtd);
-       use_size = eblocks * mtd->erasesize;
+       use_size = (uint64_t)eblocks * mtd->erasesize;
        bad_blocks = mtdswap_badblocks(mtd, use_size);
        eavailable = eblocks - bad_blocks;