]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
mm/mempool: minor coding style tweaks
authorZhiyuan Dai <daizhiyuan@phytium.com.cn>
Wed, 5 May 2021 01:40:12 +0000 (18:40 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 5 May 2021 18:27:27 +0000 (11:27 -0700)
Various coding style tweaks to various files under mm/

[daizhiyuan@phytium.com.cn: mm/swapfile: minor coding style tweaks]
Link: https://lkml.kernel.org/r/1614223624-16055-1-git-send-email-daizhiyuan@phytium.com.cn
[daizhiyuan@phytium.com.cn: mm/sparse: minor coding style tweaks]
Link: https://lkml.kernel.org/r/1614227288-19363-1-git-send-email-daizhiyuan@phytium.com.cn
[daizhiyuan@phytium.com.cn: mm/vmscan: minor coding style tweaks]
Link: https://lkml.kernel.org/r/1614227649-19853-1-git-send-email-daizhiyuan@phytium.com.cn
[daizhiyuan@phytium.com.cn: mm/compaction: minor coding style tweaks]
Link: https://lkml.kernel.org/r/1614228218-20770-1-git-send-email-daizhiyuan@phytium.com.cn
[daizhiyuan@phytium.com.cn: mm/oom_kill: minor coding style tweaks]
Link: https://lkml.kernel.org/r/1614228360-21168-1-git-send-email-daizhiyuan@phytium.com.cn
[daizhiyuan@phytium.com.cn: mm/shmem: minor coding style tweaks]
Link: https://lkml.kernel.org/r/1614228504-21491-1-git-send-email-daizhiyuan@phytium.com.cn
[daizhiyuan@phytium.com.cn: mm/page_alloc: minor coding style tweaks]
Link: https://lkml.kernel.org/r/1614228613-21754-1-git-send-email-daizhiyuan@phytium.com.cn
[daizhiyuan@phytium.com.cn: mm/filemap: minor coding style tweaks]
Link: https://lkml.kernel.org/r/1614228936-22337-1-git-send-email-daizhiyuan@phytium.com.cn
[daizhiyuan@phytium.com.cn: mm/mlock: minor coding style tweaks]
Link: https://lkml.kernel.org/r/1613956588-2453-1-git-send-email-daizhiyuan@phytium.com.cn
[daizhiyuan@phytium.com.cn: mm/frontswap: minor coding style tweaks]
Link: https://lkml.kernel.org/r/1613962668-15045-1-git-send-email-daizhiyuan@phytium.com.cn
[daizhiyuan@phytium.com.cn: mm/vmalloc: minor coding style tweaks]
Link: https://lkml.kernel.org/r/1613963379-15988-1-git-send-email-daizhiyuan@phytium.com.cn
[daizhiyuan@phytium.com.cn: mm/memory_hotplug: minor coding style tweaks]
Link: https://lkml.kernel.org/r/1613971784-24878-1-git-send-email-daizhiyuan@phytium.com.cn
[daizhiyuan@phytium.com.cn: mm/mempolicy: minor coding style tweaks]
Link: https://lkml.kernel.org/r/1613972228-25501-1-git-send-email-daizhiyuan@phytium.com.cn
Link: https://lkml.kernel.org/r/1614222374-13805-1-git-send-email-daizhiyuan@phytium.com.cn
Signed-off-by: Zhiyuan Dai <daizhiyuan@phytium.com.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 files changed:
mm/compaction.c
mm/filemap.c
mm/frontswap.c
mm/memory_hotplug.c
mm/mempolicy.c
mm/mempool.c
mm/mlock.c
mm/oom_kill.c
mm/page_alloc.c
mm/shmem.c
mm/sparse.c
mm/swapfile.c
mm/vmalloc.c
mm/vmscan.c

index 598dffbd5c8e58ea00ea83c978da62a3e2da4512..3a6c6b821f80cefd7279567ec937d23bbfe961e9 100644 (file)
@@ -2885,7 +2885,7 @@ void wakeup_kcompactd(pg_data_t *pgdat, int order, int highest_zoneidx)
  */
 static int kcompactd(void *p)
 {
-       pg_data_t *pgdat = (pg_data_t*)p;
+       pg_data_t *pgdat = (pg_data_t *)p;
        struct task_struct *tsk = current;
        unsigned int proactive_defer = 0;
 
index ecc5f8a4c4884f8384c0a254015941b45ad4170a..7fadf211643cc43c65a26d94e1976409776309b9 100644 (file)
@@ -3267,7 +3267,7 @@ const struct vm_operations_struct generic_file_vm_ops = {
 
 /* This is used for a general mmap of a disk file */
 
-int generic_file_mmap(struct file * file, struct vm_area_struct * vma)
+int generic_file_mmap(struct file *file, struct vm_area_struct *vma)
 {
        struct address_space *mapping = file->f_mapping;
 
@@ -3292,11 +3292,11 @@ vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf)
 {
        return VM_FAULT_SIGBUS;
 }
-int generic_file_mmap(struct file * file, struct vm_area_struct * vma)
+int generic_file_mmap(struct file *file, struct vm_area_struct *vma)
 {
        return -ENOSYS;
 }
-int generic_file_readonly_mmap(struct file * file, struct vm_area_struct * vma)
+int generic_file_readonly_mmap(struct file *file, struct vm_area_struct *vma)
 {
        return -ENOSYS;
 }
@@ -3724,7 +3724,7 @@ EXPORT_SYMBOL(generic_perform_write);
 ssize_t __generic_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
 {
        struct file *file = iocb->ki_filp;
-       struct address_space * mapping = file->f_mapping;
+       struct address_space *mapping = file->f_mapping;
        struct inode    *inode = mapping->host;
        ssize_t         written = 0;
        ssize_t         err;
index 2183a56c7874ba3e61930a95d5d87bde08ef9bd6..130e301c5ac034a3749ce586665af1386e13258a 100644 (file)
@@ -60,16 +60,20 @@ static u64 frontswap_succ_stores;
 static u64 frontswap_failed_stores;
 static u64 frontswap_invalidates;
 
-static inline void inc_frontswap_loads(void) {
+static inline void inc_frontswap_loads(void)
+{
        data_race(frontswap_loads++);
 }
-static inline void inc_frontswap_succ_stores(void) {
+static inline void inc_frontswap_succ_stores(void)
+{
        data_race(frontswap_succ_stores++);
 }
-static inline void inc_frontswap_failed_stores(void) {
+static inline void inc_frontswap_failed_stores(void)
+{
        data_race(frontswap_failed_stores++);
 }
-static inline void inc_frontswap_invalidates(void) {
+static inline void inc_frontswap_invalidates(void)
+{
        data_race(frontswap_invalidates++);
 }
 #else
index f7e46f54a228e2363af16c5744111e82ea6f3afb..70620d0dd923a23bd77bffef4dd8b68f6e33eb14 100644 (file)
@@ -834,7 +834,7 @@ static inline struct zone *default_zone_for_pfn(int nid, unsigned long start_pfn
        return movable_node_enabled ? movable_zone : kernel_zone;
 }
 
-struct zone * zone_for_pfn_range(int online_type, int nid, unsigned start_pfn,
+struct zone *zone_for_pfn_range(int online_type, int nid, unsigned start_pfn,
                unsigned long nr_pages)
 {
        if (online_type == MMOP_ONLINE_KERNEL)
index c0343c742bed6a1c2dc1efae93cb921fda02f66d..3ebe2cfc64aff7c7ba3de81211ca16d4aed33a62 100644 (file)
@@ -330,7 +330,7 @@ static void mpol_rebind_nodemask(struct mempolicy *pol, const nodemask_t *nodes)
        else if (pol->flags & MPOL_F_RELATIVE_NODES)
                mpol_relative_nodemask(&tmp, &pol->w.user_nodemask, nodes);
        else {
-               nodes_remap(tmp, pol->v.nodes,pol->w.cpuset_mems_allowed,
+               nodes_remap(tmp, pol->v.nodes, pol->w.cpuset_mems_allowed,
                                                                *nodes);
                pol->w.cpuset_mems_allowed = *nodes;
        }
@@ -1161,7 +1161,7 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from,
 
        tmp = *from;
        while (!nodes_empty(tmp)) {
-               int s,d;
+               int s, d;
                int source = NUMA_NO_NODE;
                int dest = 0;
 
index fe19d290a30152d60a37882790711e1747cc4678..a258cf4de57562acd8a690dd77835edb1709f807 100644 (file)
@@ -251,7 +251,7 @@ EXPORT_SYMBOL(mempool_init);
 mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn,
                                mempool_free_t *free_fn, void *pool_data)
 {
-       return mempool_create_node(min_nr,alloc_fn,free_fn, pool_data,
+       return mempool_create_node(min_nr, alloc_fn, free_fn, pool_data,
                                   GFP_KERNEL, NUMA_NO_NODE);
 }
 EXPORT_SYMBOL(mempool_create);
index f8f8cc32d03d0b31c2dbcffb87f0c3c680eef09a..df590fda56887ab5e1dee8ae6cb6b171e1a16346 100644 (file)
@@ -559,7 +559,7 @@ static int apply_vma_lock_flags(unsigned long start, size_t len,
                                vm_flags_t flags)
 {
        unsigned long nstart, end, tmp;
-       struct vm_area_struct * vma, * prev;
+       struct vm_area_struct *vma, *prev;
        int error;
 
        VM_BUG_ON(offset_in_page(start));
@@ -737,7 +737,7 @@ SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len)
  */
 static int apply_mlockall_flags(int flags)
 {
-       struct vm_area_struct * vma, * prev = NULL;
+       struct vm_area_struct *vma, *prev = NULL;
        vm_flags_t to_add = 0;
 
        current->mm->def_flags &= VM_LOCKED_CLEAR_MASK;
index fa1cf18bac978452b838d3ad61d84e4aae8706e9..3df2ac6b86865d7ca6f001d1c9f7e3605bc8c71e 100644 (file)
@@ -993,7 +993,7 @@ static void oom_kill_process(struct oom_control *oc, const char *message)
        if (oom_group) {
                mem_cgroup_print_oom_group(oom_group);
                mem_cgroup_scan_tasks(oom_group, oom_kill_memcg_member,
-                                     (void*)message);
+                                     (void *)message);
                mem_cgroup_put(oom_group);
        }
 }
index b012805a11ad4d6afaca12e7b83802720fa2a02b..bcdc0c6f21f1368ef83063ed907b236141911717 100644 (file)
@@ -8808,7 +8808,7 @@ int alloc_contig_range(unsigned long start, unsigned long end,
        ret = __alloc_contig_migrate_range(&cc, start, end);
        if (ret && ret != -EBUSY)
                goto done;
-       ret =0;
+       ret = 0;
 
        /*
         * Pages from [start, end) are within a MAX_ORDER_NR_PAGES
index 162d8f8993bbf4b8ae49cdc89cc3fb29d6806dd0..a08cedefbfaa65f6eb28d9abc74545328e575960 100644 (file)
@@ -3508,7 +3508,7 @@ static int shmem_parse_options(struct fs_context *fc, void *data)
                        }
                }
                if (*this_char) {
-                       char *value = strchr(this_char,'=');
+                       char *value = strchr(this_char, '=');
                        size_t len = 0;
                        int err;
 
index d3fbed26e64efa0472abe3cdeb8a1b1fa6f40376..b2ada9dc00cb400c707fee147b8591f156a62025 100644 (file)
@@ -257,7 +257,7 @@ static void __init memory_present(int nid, unsigned long start, unsigned long en
        if (unlikely(!mem_section)) {
                unsigned long size, align;
 
-               size = sizeof(struct mem_section*) * NR_SECTION_ROOTS;
+               size = sizeof(struct mem_section *) * NR_SECTION_ROOTS;
                align = 1 << (INTERNODE_CACHE_SHIFT);
                mem_section = memblock_alloc(size, align);
                if (!mem_section)
index 084a5b9a18e5c36b031809769482781c1f7a60ff..149e77454e3c500688646e5a93a9bb553dbb4b7f 100644 (file)
@@ -2780,7 +2780,7 @@ static int swap_show(struct seq_file *swap, void *v)
        unsigned int bytes, inuse;
 
        if (si == SEQ_START_TOKEN) {
-               seq_puts(swap,"Filename\t\t\t\tType\t\tSize\t\tUsed\t\tPriority\n");
+               seq_puts(swap, "Filename\t\t\t\tType\t\tSize\t\tUsed\t\tPriority\n");
                return 0;
        }
 
@@ -3284,7 +3284,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
                                         sizeof(long),
                                         GFP_KERNEL);
 
-       if (p->bdev &&(swap_flags & SWAP_FLAG_DISCARD) && swap_discardable(p)) {
+       if (p->bdev && (swap_flags & SWAP_FLAG_DISCARD) && swap_discardable(p)) {
                /*
                 * When discard is enabled for swap with no particular
                 * policy flagged, we set all swap discard flags here in
index d33894d7b27a1d1a1c42b3982d65b08108cf1c58..9c539f0730a510738cebabb878e6ab4ca5083241 100644 (file)
@@ -3083,7 +3083,7 @@ EXPORT_SYMBOL(vzalloc_node);
  * 64b systems should always have either DMA or DMA32 zones. For others
  * GFP_DMA32 should do the right thing and use the normal zone.
  */
-#define GFP_VMALLOC32 GFP_DMA32 | GFP_KERNEL
+#define GFP_VMALLOC32 (GFP_DMA32 | GFP_KERNEL)
 #endif
 
 /**
index 44c49acf10c4c6dbada1b039d4446082f9facaa4..5199b9696babf7a44c1dc500d63e2d2aefe23986 100644 (file)
@@ -4059,7 +4059,7 @@ static int kswapd(void *p)
 {
        unsigned int alloc_order, reclaim_order;
        unsigned int highest_zoneidx = MAX_NR_ZONES - 1;
-       pg_data_t *pgdat = (pg_data_t*)p;
+       pg_data_t *pgdat = (pg_data_t *)p;
        struct task_struct *tsk = current;
        const struct cpumask *cpumask = cpumask_of_node(pgdat->node_id);