]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mm: use fallthrough;
authorJoe Perches <joe@perches.com>
Tue, 7 Apr 2020 03:08:39 +0000 (20:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 7 Apr 2020 17:43:41 +0000 (10:43 -0700)
Convert the various /* fallthrough */ comments to the pseudo-keyword
fallthrough;

Done via script:
https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe@perches.com/

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Link: http://lkml.kernel.org/r/f62fea5d10eb0ccfc05d87c242a620c261219b66.camel@perches.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/gup.c
mm/hugetlb_cgroup.c
mm/ksm.c
mm/list_lru.c
mm/memcontrol.c
mm/mempolicy.c
mm/mmap.c
mm/shmem.c
mm/zsmalloc.c

index b185377c38b7d2854e13d5c6dbe9e396f9c3aa0b..a21230569520913dedbae1ceec94f2df504eb9f4 100644 (file)
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1102,7 +1102,7 @@ retry:
                                goto retry;
                        case -EBUSY:
                                ret = 0;
-                               /* FALLTHRU */
+                               fallthrough;
                        case -EFAULT:
                        case -ENOMEM:
                        case -EHWPOISON:
index c2d7ae6cabd1a0413f0b0e03d35cde1c626a7fd3..aabf65d4d91bacc9987f1faed41f834368b39b40 100644 (file)
@@ -467,14 +467,14 @@ static int hugetlb_cgroup_read_u64_max(struct seq_file *seq, void *v)
        switch (MEMFILE_ATTR(cft->private)) {
        case RES_RSVD_USAGE:
                counter = &h_cg->rsvd_hugepage[idx];
-               /* Fall through. */
+               fallthrough;
        case RES_USAGE:
                val = (u64)page_counter_read(counter);
                seq_printf(seq, "%llu\n", val * PAGE_SIZE);
                break;
        case RES_RSVD_LIMIT:
                counter = &h_cg->rsvd_hugepage[idx];
-               /* Fall through. */
+               fallthrough;
        case RES_LIMIT:
                val = (u64)counter->max;
                if (val == limit)
@@ -514,7 +514,7 @@ static ssize_t hugetlb_cgroup_write(struct kernfs_open_file *of,
        switch (MEMFILE_ATTR(of_cft(of)->private)) {
        case RES_RSVD_LIMIT:
                rsvd = true;
-               /* Fall through. */
+               fallthrough;
        case RES_LIMIT:
                mutex_lock(&hugetlb_limit_mutex);
                ret = page_counter_set_max(
index 363ec81895612edab3e67647d655231ad8b2972d..a558da9e717709e60cb31ab62a2ce9deebcb095c 100644 (file)
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -2813,8 +2813,7 @@ static int ksm_memory_callback(struct notifier_block *self,
                 */
                ksm_check_stable_tree(mn->start_pfn,
                                      mn->start_pfn + mn->nr_pages);
-               /* fallthrough */
-
+               fallthrough;
        case MEM_CANCEL_OFFLINE:
                mutex_lock(&ksm_thread_mutex);
                ksm_run &= ~KSM_RUN_OFFLINE;
index 8de5e3784ee4699e35007504d5f94ee91a75f2fc..4d5294c39bba7c0ecbc7f522e189dd4ce5a760f5 100644 (file)
@@ -223,7 +223,7 @@ restart:
                switch (ret) {
                case LRU_REMOVED_RETRY:
                        assert_spin_locked(&nlru->lock);
-                       /* fall through */
+                       fallthrough;
                case LRU_REMOVED:
                        isolated++;
                        nlru->nr_items--;
index 9965a77d53e5bf06c1a2140c3002da9cf634fa69..05b4ec2c6499daff7f658a95b6d5ab5f9d5605c7 100644 (file)
@@ -5813,7 +5813,7 @@ retry:
                switch (get_mctgt_type(vma, addr, ptent, &target)) {
                case MC_TARGET_DEVICE:
                        device = true;
-                       /* fall through */
+                       fallthrough;
                case MC_TARGET_PAGE:
                        page = target.page;
                        /*
index c4118bb508ec8818c80537023e7c8db10ffab9bf..b4a039d779b0a4adafe30764e775223e2ce0ca56 100644 (file)
@@ -881,7 +881,6 @@ static void get_policy_nodemask(struct mempolicy *p, nodemask_t *nodes)
 
        switch (p->mode) {
        case MPOL_BIND:
-               /* Fall through */
        case MPOL_INTERLEAVE:
                *nodes = p->v.nodes;
                break;
@@ -2066,7 +2065,6 @@ bool init_nodemask_of_mempolicy(nodemask_t *mask)
                break;
 
        case MPOL_BIND:
-               /* Fall through */
        case MPOL_INTERLEAVE:
                *mask =  mempolicy->v.nodes;
                break;
@@ -2333,7 +2331,6 @@ bool __mpol_equal(struct mempolicy *a, struct mempolicy *b)
 
        switch (a->mode) {
        case MPOL_BIND:
-               /* Fall through */
        case MPOL_INTERLEAVE:
                return !!nodes_equal(a->v.nodes, b->v.nodes);
        case MPOL_PREFERRED:
index aa09429d5888a7358514053ff4c7853be64f3b87..8d77dbbb80fe724603e3aaf94d5857195aabb5d4 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1460,7 +1460,7 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
                         * with MAP_SHARED to preserve backward compatibility.
                         */
                        flags &= LEGACY_MAP_MASK;
-                       /* fall through */
+                       fallthrough;
                case MAP_SHARED_VALIDATE:
                        if (flags & ~flags_mask)
                                return -EOPNOTSUPP;
@@ -1487,8 +1487,7 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
                        vm_flags |= VM_SHARED | VM_MAYSHARE;
                        if (!(file->f_mode & FMODE_WRITE))
                                vm_flags &= ~(VM_MAYWRITE | VM_SHARED);
-
-                       /* fall through */
+                       fallthrough;
                case MAP_PRIVATE:
                        if (!(file->f_mode & FMODE_READ))
                                return -EACCES;
index 8d0aba1cc155a2e132fffd8148fad1ded230e33a..d722eb830317022d0b18392cdd7e61bc2d52195e 100644 (file)
@@ -3996,7 +3996,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 */
+                       fallthrough;
                case SHMEM_HUGE_ADVISE:
                        /* TODO: implement fadvise() hints */
                        return (vma->vm_flags & VM_HUGEPAGE);
index 2aa2d524a34331bc922f8d2aef75d6765c027b2a..2f836a2b993f0cf16a3cf2d6c28e8a52d30ba604 100644 (file)
@@ -424,7 +424,7 @@ static void *zs_zpool_map(void *pool, unsigned long handle,
        case ZPOOL_MM_WO:
                zs_mm = ZS_MM_WO;
                break;
-       case ZPOOL_MM_RW: /* fall through */
+       case ZPOOL_MM_RW:
        default:
                zs_mm = ZS_MM_RW;
                break;