From nobody Sun Oct 5 22:01:44 2025 Received: from smtpbgau1.qq.com (smtpbgau1.qq.com [54.206.16.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C242F281525 for ; Tue, 29 Jul 2025 08:48:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.206.16.166 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753778901; cv=none; b=TZ5h3GnQ2Pdhas/5KBEIb8UQo1sDjyTCwfPE/LqLCJ4oRaKnum+mvPZZBEgxk5COV7p2+Elmlw9wbk1cA20Xm5SyCJYYiCV4eFafLOEFBKlGF66bNw/QVmka8nzgrNsEdJti8D2wue6OVvDOszBVn9SEjr8aJtfdVcaUvLKcMpk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753778901; c=relaxed/simple; bh=CzfVOeOWVqaknp53Rz/3Ro0C/F4X8MQKFsFvT1rYJ/A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=byxxKaYXmx0x5FXI+9ryg1lMv1E+QJNbF6/ObEdIjUZD80sioN0OSX1gFDrdHY0Fe59hkUwLruRhIMqSfrV1fZOyP6Q0xyzYU0XJUDS/9CGrVXuA2sDBhBHJ1LwomU92hG1P3x2Es+3irjF50efynEpls5i+nmRx+X14l5K+80o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com; spf=pass smtp.mailfrom=uniontech.com; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b=FhSkqwt0; arc=none smtp.client-ip=54.206.16.166 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=uniontech.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b="FhSkqwt0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uniontech.com; s=onoh2408; t=1753778838; bh=VLq1PupNl4epQ/eqFgJeI/b4qy5mdRvi3g/owsVSuA0=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=FhSkqwt0nnPtAqm4q6BL39Jc3uxBS83jgcblHf5g0aqL3IzQBIZAoJIo5hkgPPTH3 Jh4twdN2KH0rIeM0/PXyxbIuucpH7yIUzewM7GzlAiAB7D1+vuCeHHtjDmjmjffgn2 seym/xN47xtjMvsj1hIbtGmwP6xnRS03ulKDDPzE= X-QQ-mid: zesmtpip3t1753778825te45995f8 X-QQ-Originating-IP: tSCf3VyPzUnUetiPvgXt758R68S3WC3VgNrI2JAXLJI= Received: from avenger-e500 ( [localhost]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 29 Jul 2025 16:47:03 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 1 X-BIZMAIL-ID: 3458122844410139732 EX-QQ-RecipientCnt: 12 From: WangYuli To: akpm@linux-foundation.org, Liam.Howlett@oracle.com, lorenzo.stoakes@oracle.com, vbabka@suse.cz, jannh@google.com, pfalcato@suse.de Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, niecheng1@uniontech.com, guanwentao@uniontech.com, WangYuli , Jun Zhan Subject: [PATCH] tools/testing/vma: Fix function parameter declarations for GCC 8.3 compatibility Date: Tue, 29 Jul 2025 16:47:00 +0800 Message-ID: X-Mailer: git-send-email 2.50.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-QQ-SENDSIZE: 520 Feedback-ID: zesmtpip:uniontech.com:qybglogicsvrgz:qybglogicsvrgz8a-1 X-QQ-XMAILINFO: NDxI9psdf3YV3rs/Uk6soL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KSPAM: 0 The Linux kernel's minimum GCC version requirement has been bumped from 4.3 to 8.3, but this tool still fails to compile with GCC 8.3. Older compilers would fail if did not include parameter names in function declarations that contained parameter types; newer compilers are more lenient about this. Fix many errors like this: In file included from vma.c:10: vma_internal.h: In function =E2=80=98arch_validate_flags=E2=80=99: vma_internal.h:1218:40: error: parameter name omitted static inline bool arch_validate_flags(unsigned long) ^~~~~~~~~~~~~ vma.c: In function =E2=80=98dummy_close=E2=80=99: vma.c:281:25: error: parameter name omitted static void dummy_close(struct vm_area_struct *) ^~~~~~~~~~~~~~~~~~~~~~~ Reported-by: Jun Zhan Signed-off-by: WangYuli --- tools/testing/vma/vma.c | 2 +- tools/testing/vma/vma_internal.h | 110 +++++++++++++++---------------- 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/tools/testing/vma/vma.c b/tools/testing/vma/vma.c index 2be7597a2ac2..390b6a711f97 100644 --- a/tools/testing/vma/vma.c +++ b/tools/testing/vma/vma.c @@ -278,7 +278,7 @@ static bool vma_write_started(struct vm_area_struct *vm= a) } =20 /* Helper function providing a dummy vm_ops->close() method.*/ -static void dummy_close(struct vm_area_struct *) +static void dummy_close(struct vm_area_struct *vma) { } =20 diff --git a/tools/testing/vma/vma_internal.h b/tools/testing/vma/vma_inter= nal.h index 816e7e057585..4935460102e5 100644 --- a/tools/testing/vma/vma_internal.h +++ b/tools/testing/vma/vma_internal.h @@ -288,8 +288,8 @@ struct vm_area_desc { }; =20 struct file_operations { - int (*mmap)(struct file *, struct vm_area_struct *); - int (*mmap_prepare)(struct vm_area_desc *); + int (*mmap)(struct file *file, struct vm_area_struct *vma); + int (*mmap_prepare)(struct vm_area_desc *desc); }; =20 struct file { @@ -840,11 +840,11 @@ static inline unsigned long vma_pages(struct vm_area_= struct *vma) return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; } =20 -static inline void fput(struct file *) +static inline void fput(struct file *file) { } =20 -static inline void mpol_put(struct mempolicy *) +static inline void mpol_put(struct mempolicy *policy) { } =20 @@ -852,15 +852,15 @@ static inline void lru_add_drain(void) { } =20 -static inline void tlb_gather_mmu(struct mmu_gather *, struct mm_struct *) +static inline void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct= *mm) { } =20 -static inline void update_hiwater_rss(struct mm_struct *) +static inline void update_hiwater_rss(struct mm_struct *mm) { } =20 -static inline void update_hiwater_vm(struct mm_struct *) +static inline void update_hiwater_vm(struct mm_struct *mm) { } =20 @@ -890,15 +890,15 @@ static inline void free_pgtables(struct mmu_gather *t= lb, struct ma_state *mas, (void)mm_wr_locked; } =20 -static inline void mapping_unmap_writable(struct address_space *) +static inline void mapping_unmap_writable(struct address_space *mapping) { } =20 -static inline void flush_dcache_mmap_lock(struct address_space *) +static inline void flush_dcache_mmap_lock(struct address_space *mapping) { } =20 -static inline void tlb_finish_mmu(struct mmu_gather *) +static inline void tlb_finish_mmu(struct mmu_gather *tlb) { } =20 @@ -907,7 +907,7 @@ static inline struct file *get_file(struct file *f) return f; } =20 -static inline int vma_dup_policy(struct vm_area_struct *, struct vm_area_s= truct *) +static inline int vma_dup_policy(struct vm_area_struct *dst, struct vm_are= a_struct *src) { return 0; } @@ -940,7 +940,7 @@ static inline void vma_adjust_trans_huge(struct vm_area= _struct *vma, (void)next; } =20 -static inline void hugetlb_split(struct vm_area_struct *, unsigned long) {} +static inline void hugetlb_split(struct vm_area_struct *vma, unsigned long= addr) {} =20 static inline void vma_iter_free(struct vma_iterator *vmi) { @@ -957,31 +957,31 @@ static inline void vm_acct_memory(long pages) { } =20 -static inline void vma_interval_tree_insert(struct vm_area_struct *, - struct rb_root_cached *) +static inline void vma_interval_tree_insert(struct vm_area_struct *vma, + struct rb_root_cached *root) { } =20 -static inline void vma_interval_tree_remove(struct vm_area_struct *, - struct rb_root_cached *) +static inline void vma_interval_tree_remove(struct vm_area_struct *vma, + struct rb_root_cached *root) { } =20 -static inline void flush_dcache_mmap_unlock(struct address_space *) +static inline void flush_dcache_mmap_unlock(struct address_space *mapping) { } =20 -static inline void anon_vma_interval_tree_insert(struct anon_vma_chain*, - struct rb_root_cached *) +static inline void anon_vma_interval_tree_insert(struct anon_vma_chain *av= c, + struct rb_root_cached *root) { } =20 -static inline void anon_vma_interval_tree_remove(struct anon_vma_chain*, - struct rb_root_cached *) +static inline void anon_vma_interval_tree_remove(struct anon_vma_chain *av= c, + struct rb_root_cached *root) { } =20 -static inline void uprobe_mmap(struct vm_area_struct *) +static inline void uprobe_mmap(struct vm_area_struct *vma) { } =20 @@ -993,15 +993,15 @@ static inline void uprobe_munmap(struct vm_area_struc= t *vma, (void)end; } =20 -static inline void i_mmap_lock_write(struct address_space *) +static inline void i_mmap_lock_write(struct address_space *mapping) { } =20 -static inline void anon_vma_lock_write(struct anon_vma *) +static inline void anon_vma_lock_write(struct anon_vma *anon_vma) { } =20 -static inline void vma_assert_write_locked(struct vm_area_struct *) +static inline void vma_assert_write_locked(struct vm_area_struct *vma) { } =20 @@ -1011,16 +1011,16 @@ static inline void unlink_anon_vmas(struct vm_area_= struct *vma) vma->anon_vma->was_unlinked =3D true; } =20 -static inline void anon_vma_unlock_write(struct anon_vma *) +static inline void anon_vma_unlock_write(struct anon_vma *anon_vma) { } =20 -static inline void i_mmap_unlock_write(struct address_space *) +static inline void i_mmap_unlock_write(struct address_space *mapping) { } =20 -static inline void anon_vma_merge(struct vm_area_struct *, - struct vm_area_struct *) +static inline void anon_vma_merge(struct vm_area_struct *vma, + struct vm_area_struct *prev) { } =20 @@ -1037,19 +1037,19 @@ static inline int userfaultfd_unmap_prep(struct vm_= area_struct *vma, return 0; } =20 -static inline void mmap_write_downgrade(struct mm_struct *) +static inline void mmap_write_downgrade(struct mm_struct *mm) { } =20 -static inline void mmap_read_unlock(struct mm_struct *) +static inline void mmap_read_unlock(struct mm_struct *mm) { } =20 -static inline void mmap_write_unlock(struct mm_struct *) +static inline void mmap_write_unlock(struct mm_struct *mm) { } =20 -static inline int mmap_write_lock_killable(struct mm_struct *) +static inline int mmap_write_lock_killable(struct mm_struct *mm) { return 0; } @@ -1074,11 +1074,11 @@ static inline void arch_unmap(struct mm_struct *mm, (void)end; } =20 -static inline void mmap_assert_locked(struct mm_struct *) +static inline void mmap_assert_locked(struct mm_struct *mm) { } =20 -static inline bool mpol_equal(struct mempolicy *, struct mempolicy *) +static inline bool mpol_equal(struct mempolicy *a, struct mempolicy *b) { return true; } @@ -1090,59 +1090,59 @@ static inline void khugepaged_enter_vma(struct vm_a= rea_struct *vma, (void)vm_flags; } =20 -static inline bool mapping_can_writeback(struct address_space *) +static inline bool mapping_can_writeback(struct address_space *mapping) { return true; } =20 -static inline bool is_vm_hugetlb_page(struct vm_area_struct *) +static inline bool is_vm_hugetlb_page(struct vm_area_struct *vma) { return false; } =20 -static inline bool vma_soft_dirty_enabled(struct vm_area_struct *) +static inline bool vma_soft_dirty_enabled(struct vm_area_struct *vma) { return false; } =20 -static inline bool userfaultfd_wp(struct vm_area_struct *) +static inline bool userfaultfd_wp(struct vm_area_struct *vma) { return false; } =20 -static inline void mmap_assert_write_locked(struct mm_struct *) +static inline void mmap_assert_write_locked(struct mm_struct *mm) { } =20 -static inline void mutex_lock(struct mutex *) +static inline void mutex_lock(struct mutex *lock) { } =20 -static inline void mutex_unlock(struct mutex *) +static inline void mutex_unlock(struct mutex *lock) { } =20 -static inline bool mutex_is_locked(struct mutex *) +static inline bool mutex_is_locked(struct mutex *lock) { return true; } =20 -static inline bool signal_pending(void *) +static inline bool signal_pending(void *task) { return false; } =20 -static inline bool is_file_hugepages(struct file *) +static inline bool is_file_hugepages(struct file *file) { return false; } =20 -static inline int security_vm_enough_memory_mm(struct mm_struct *, long) +static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long = pages) { return 0; } =20 -static inline bool may_expand_vm(struct mm_struct *, vm_flags_t, unsigned = long) +static inline bool may_expand_vm(struct mm_struct *mm, vm_flags_t flags, u= nsigned long npages) { return true; } @@ -1167,7 +1167,7 @@ static inline void vm_flags_clear(struct vm_area_stru= ct *vma, vma->__vm_flags &=3D ~flags; } =20 -static inline int shmem_zero_setup(struct vm_area_struct *) +static inline int shmem_zero_setup(struct vm_area_struct *vma) { return 0; } @@ -1177,20 +1177,20 @@ static inline void vma_set_anonymous(struct vm_area= _struct *vma) vma->vm_ops =3D NULL; } =20 -static inline void ksm_add_vma(struct vm_area_struct *) +static inline void ksm_add_vma(struct vm_area_struct *vma) { } =20 -static inline void perf_event_mmap(struct vm_area_struct *) +static inline void perf_event_mmap(struct vm_area_struct *vma) { } =20 -static inline bool vma_is_dax(struct vm_area_struct *) +static inline bool vma_is_dax(struct vm_area_struct *vma) { return false; } =20 -static inline struct vm_area_struct *get_gate_vma(struct mm_struct *) +static inline struct vm_area_struct *get_gate_vma(struct mm_struct *mm) { return NULL; } @@ -1215,16 +1215,16 @@ static inline void vma_set_page_prot(struct vm_area= _struct *vma) WRITE_ONCE(vma->vm_page_prot, vm_page_prot); } =20 -static inline bool arch_validate_flags(unsigned long) +static inline bool arch_validate_flags(unsigned long flags) { return true; } =20 -static inline void vma_close(struct vm_area_struct *) +static inline void vma_close(struct vm_area_struct *vma) { } =20 -static inline int mmap_file(struct file *, struct vm_area_struct *) +static inline int mmap_file(struct file *file, struct vm_area_struct *vma) { return 0; } --=20 2.50.0