mm/shmem.c: mark expected switch fall-through
[sfrench/cifs-2.6.git] / mm / shmem.c
index 07a1d22807beb7cfb5f85c3343a5eacdc28fb523..ab22eaa2412eac0ef6c0bc434ed56b81cfe19432 100644 (file)
@@ -338,7 +338,7 @@ static int shmem_radix_tree_replace(struct address_space *mapping,
        if (item != expected)
                return -ENOENT;
        __radix_tree_replace(&mapping->page_tree, node, pslot,
-                            replacement, NULL, NULL);
+                            replacement, NULL);
        return 0;
 }
 
@@ -747,7 +747,7 @@ void shmem_unlock_mapping(struct address_space *mapping)
        pgoff_t indices[PAGEVEC_SIZE];
        pgoff_t index = 0;
 
-       pagevec_init(&pvec, 0);
+       pagevec_init(&pvec);
        /*
         * Minor point, but we might as well stop if someone else SHM_LOCKs it.
         */
@@ -790,7 +790,7 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend,
        if (lend == -1)
                end = -1;       /* unsigned, so actually very big */
 
-       pagevec_init(&pvec, 0);
+       pagevec_init(&pvec);
        index = start;
        while (index < end) {
                pvec.nr = find_get_entries(mapping, index,
@@ -2528,7 +2528,7 @@ static pgoff_t shmem_seek_hole_data(struct address_space *mapping,
        bool done = false;
        int i;
 
-       pagevec_init(&pvec, 0);
+       pagevec_init(&pvec);
        pvec.nr = 1;            /* start small: we may be there already */
        while (!done) {
                pvec.nr = find_get_entries(mapping, index,
@@ -3862,12 +3862,11 @@ static void shmem_init_inode(void *foo)
        inode_init_once(&info->vfs_inode);
 }
 
-static int shmem_init_inodecache(void)
+static void shmem_init_inodecache(void)
 {
        shmem_inode_cachep = kmem_cache_create("shmem_inode_cache",
                                sizeof(struct shmem_inode_info),
                                0, SLAB_PANIC|SLAB_ACCOUNT, shmem_init_inode);
-       return 0;
 }
 
 static void shmem_destroy_inodecache(void)
@@ -3991,9 +3990,7 @@ int __init shmem_init(void)
        if (shmem_inode_cachep)
                return 0;
 
-       error = shmem_init_inodecache();
-       if (error)
-               goto out3;
+       shmem_init_inodecache();
 
        error = register_filesystem(&shmem_fs_type);
        if (error) {
@@ -4020,7 +4017,6 @@ out1:
        unregister_filesystem(&shmem_fs_type);
 out2:
        shmem_destroy_inodecache();
-out3:
        shm_mnt = ERR_PTR(error);
        return error;
 }
@@ -4102,6 +4098,7 @@ bool shmem_huge_enabled(struct vm_area_struct *vma)
                        if (i_size >= HPAGE_PMD_SIZE &&
                                        i_size >> PAGE_SHIFT >= off)
                                return true;
+                       /* fall through */
                case SHMEM_HUGE_ADVISE:
                        /* TODO: implement fadvise() hints */
                        return (vma->vm_flags & VM_HUGEPAGE);