From patchwork Thu Jun 13 19:22:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alexey Dobriyan X-Patchwork-Id: 13697402 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF98CC27C75 for ; Thu, 13 Jun 2024 19:22:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 501606B00CD; Thu, 13 Jun 2024 15:22:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4B1336B00CF; Thu, 13 Jun 2024 15:22:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 32A3F6B00D0; Thu, 13 Jun 2024 15:22:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 15D5E6B00CD for ; Thu, 13 Jun 2024 15:22:25 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id B643E802F0 for ; Thu, 13 Jun 2024 19:22:24 +0000 (UTC) X-FDA: 82226836608.09.1FEF5CD Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by imf03.hostedemail.com (Postfix) with ESMTP id DBC6720002 for ; Thu, 13 Jun 2024 19:22:22 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Ft2Lichv; spf=pass (imf03.hostedemail.com: domain of adobriyan@gmail.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=adobriyan@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718306541; a=rsa-sha256; cv=none; b=MSIWYxwV7FHOtc9XUHWqT1jxUn2SZXFQNVCmoFhgrUxkNihDLJznN3Rgf/dbDdPzUjEwQE dLc2O0NT9IesOcgO+t/7laWvJeLiC6Y9EBoySb8Im45pZv+WI3pD8idiql8L5oEBoj6v5b 9VHf2GZgfswD2tj1gt8i0kcpyH6rARY= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Ft2Lichv; spf=pass (imf03.hostedemail.com: domain of adobriyan@gmail.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=adobriyan@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718306541; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=imGPK4z3NEfZjdDaqJiJJhSbCgQiRrtwTd3vB04zoVI=; b=xDSAipuG2ROB5TxIkSJRqfxX90ETtqPfr2vk5VX4LReV+vbkuh60lUcoCNDpIOM6sdVZth rnwYhECQ+TwJmdMVxpw5TBW6XnEY+thlfYlFI1wAe4Sn3v7HkboIdHlUPV1Xg82IeeL/ik gmNit5XkG0cqTpQFHW6hTEdaTg7yB2w= Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-42172ed3597so9248555e9.0 for ; Thu, 13 Jun 2024 12:22:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718306541; x=1718911341; darn=kvack.org; h=content-transfer-encoding:content-disposition:mime-version :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=imGPK4z3NEfZjdDaqJiJJhSbCgQiRrtwTd3vB04zoVI=; b=Ft2LichvY2pkWuP4elPMXXXX/sHl4LKL6zuhk7unU9ieE1eDp/q5zYKZ6YqrO9E0lA ZTzFCbJ7ynJK2+An7s4mhR5bWioNe+mW982cPSufpiE1ckqfr2Eg/nrOSjZ2QVPLaxGP 6sf47VQp1wvdCTG346bpjY8pMXj36JJNyrcKyL8aI2qycK8jezH6unDi8hAYi0VhvXVv EhBghuospXwgo3xB85XuoBDM7YmYcimEGOgNWTtHXa/LGr6jrwMY5LhlqDr1BBaBGkQP ih69e0OE8VTz40Fa/q6Wi+lzNaJbzfDjDkt5/dPE2evycFTGScS7qMKgtFuT2Qd3eO5E zKeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718306541; x=1718911341; h=content-transfer-encoding:content-disposition:mime-version :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=imGPK4z3NEfZjdDaqJiJJhSbCgQiRrtwTd3vB04zoVI=; b=rn387k2FcyjNjnSZi1wZCcUdtHAHu/JmniHaN98S2YDYA0YUb2wsNIrZd1osIRdHDA 8hS9Udptl+lMHczMcmadZhLoD3GAYOK0WnLLlkUcpvj1z6q3j5oqMykrhGqXPLmfnpv5 Cp1xK59Rmqpu64QaNq3AbeoIIMcKHNvDJH7GO2xysRzHQb8uyeB6piLjSRJBpCgYnWxY /vXCy6PqzdINqfFElgAnmj2UvtnTtlqRt7D6jUEQgSL97JlzT/LrkZr0CC6ODkE1OBQw c8vtXj3rjJl+rlTILS9g/N2J00eBJ5Vs99cW9IO4mIQOIERoJzVnwE0E10eRQ/rcJEK+ 9dYA== X-Forwarded-Encrypted: i=1; AJvYcCWbTqtc8M9ttcVVxRw9T8IC2DOGOdzq8h18aNyyBmTGk6OBpw9+hIPuwCc2YG6ia4gT3v6msExdMBrDPb6jsq5tSYI= X-Gm-Message-State: AOJu0YyrP1LUz1fPiULTFmWSWOkji6OM5gk8Ren3502nEaOvKF3PWA6X BdM3/Rx0QvyylBBObT4+M8XjiYYQf3egtsIgWMdS7Yh5qqJNfz+Rglyx X-Google-Smtp-Source: AGHT+IFH3yjMnIlYZVz60Gd2uWIgUoqeFphBchYabfiO5ee8/amBOEzYRoX9UrhLZ9icxXjC3KMjCw== X-Received: by 2002:a05:600c:19cf:b0:421:7ab8:59c with SMTP id 5b1f17b1804b1-42304825ce7mr8523605e9.10.1718306541180; Thu, 13 Jun 2024 12:22:21 -0700 (PDT) Received: from p183 ([46.53.250.201]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-422f6127d6dsm34575855e9.26.2024.06.13.12.22.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 12:22:20 -0700 (PDT) Date: Thu, 13 Jun 2024 22:22:18 +0300 From: Alexey Dobriyan To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-security-module@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH] linux++: delete some forward declarations Message-ID: <5ad5556c-7c32-45b7-89cf-f723c9d7332b@p183> MIME-Version: 1.0 Content-Disposition: inline X-Stat-Signature: 8hczgzdkb9np57gtp8hh3ehaxdphzeut X-Rspamd-Queue-Id: DBC6720002 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1718306542-524203 X-HE-Meta: U2FsdGVkX18sLzylYtXGaouDY5Hjo8BxhapW4j8wEc4IuVjhIxX+PNCHgit/c9ZpcmYVV7wFb39nSYwf3LUzjcVpOKaA9z9a0au5FlWCu5i+rlHE0lOE/p+saKWQO8tnuegdgjKERXIyNZ63g1RGbUOyAMyMjDrfhbH/tQvydIz0swkSkmADCk/uyLFTT0WYr6yyJicE7AMt1ivw5YaSN3FnuRuElH3c/Tlw51eK98572SQk9An/0ulhkBf2VjdMClikjVlRSwVY/n0N5LgvAKch8iLYi00rD1q169wxcS33Uy07WJzHbYqLrAjOEoeic3X1Yng4L/dUxk7XpmU7nRTGSTLOzFcJ5sxfb+kHyNTxFy8gyuquCirqCgQeR0tfGCfr1JYSQ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precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: g++ doesn't like forward enum declarations: error: use of enum ā€˜Eā€™ without previous declaration 64 | enum E; Delete those which aren't used. Delete some unused/unnecessary forward struct declarations for a change. Signed-off-by: Alexey Dobriyan --- fs/ramfs/inode.c | 1 - include/linux/console.h | 2 -- include/linux/device.h | 3 --- include/linux/ftrace.h | 4 ---- include/linux/security.h | 6 ------ include/linux/signal.h | 2 -- include/linux/syscalls.h | 7 ------- include/linux/sysfs.h | 2 -- mm/internal.h | 4 ---- mm/shmem.c | 1 - 10 files changed, 32 deletions(-) --- a/fs/ramfs/inode.c +++ b/fs/ramfs/inode.c @@ -51,7 +51,6 @@ struct ramfs_fs_info { #define RAMFS_DEFAULT_MODE 0755 -static const struct super_operations ramfs_ops; static const struct inode_operations ramfs_dir_inode_operations; struct inode *ramfs_get_inode(struct super_block *sb, --- a/include/linux/console.h +++ b/include/linux/console.h @@ -21,10 +21,8 @@ #include struct vc_data; -struct console_font_op; struct console_font; struct module; -struct tty_struct; struct notifier_block; enum con_scroll { --- a/include/linux/device.h +++ b/include/linux/device.h @@ -36,10 +36,7 @@ struct device; struct device_private; struct device_driver; -struct driver_private; struct module; -struct class; -struct subsys_private; struct device_node; struct fwnode_handle; struct iommu_group; --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -531,8 +531,6 @@ extern const void *ftrace_expected; void ftrace_bug(int err, struct dyn_ftrace *rec); -struct seq_file; - extern int ftrace_text_reserved(const void *start, const void *end); struct ftrace_ops *ftrace_ops_trampoline(unsigned long addr); @@ -1147,8 +1145,6 @@ static inline void unpause_graph_tracing(void) { } #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ #ifdef CONFIG_TRACING -enum ftrace_dump_mode; - #define MAX_TRACER_SIZE 100 extern char ftrace_dump_on_oops[]; extern int ftrace_dump_on_oops_enabled(void); --- a/include/linux/security.h +++ b/include/linux/security.h @@ -41,7 +41,6 @@ struct rlimit; struct kernel_siginfo; struct sembuf; struct kern_ipc_perm; -struct audit_context; struct super_block; struct inode; struct dentry; @@ -59,8 +58,6 @@ struct xfrm_sec_ctx; struct mm_struct; struct fs_context; struct fs_parameter; -enum fs_value_type; -struct watch; struct watch_notification; struct lsm_ctx; @@ -183,8 +180,6 @@ struct sock; struct sockaddr; struct socket; struct flowi_common; -struct dst_entry; -struct xfrm_selector; struct xfrm_policy; struct xfrm_state; struct xfrm_user_sec_ctx; @@ -219,7 +214,6 @@ extern unsigned long dac_mmap_min_addr; #define LSM_PRLIMIT_WRITE 2 /* forward declares to avoid warnings */ -struct sched_param; struct request_sock; /* bprm->unsafe reasons */ --- a/include/linux/signal.h +++ b/include/linux/signal.h @@ -274,8 +274,6 @@ static inline int valid_signal(unsigned long sig) return sig <= _NSIG ? 1 : 0; } -struct timespec; -struct pt_regs; enum pid_type; extern int next_signal(struct sigpending *pending, sigset_t *mask); --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -11,8 +11,6 @@ struct __aio_sigset; struct epoll_event; -struct iattr; -struct inode; struct iocb; struct io_event; struct iovec; @@ -20,14 +18,12 @@ struct __kernel_old_itimerval; struct kexec_segment; struct linux_dirent; struct linux_dirent64; -struct list_head; struct mmap_arg_struct; struct msgbuf; struct user_msghdr; struct mmsghdr; struct msqid_ds; struct new_utsname; -struct nfsctl_arg; struct __old_kernel_stat; struct oldold_utsname; struct old_utsname; @@ -38,7 +34,6 @@ struct rusage; struct sched_param; struct sched_attr; struct sel_arg_struct; -struct semaphore; struct sembuf; struct shmid_ds; struct sockaddr; @@ -48,14 +43,12 @@ struct statfs; struct statfs64; struct statx; struct sysinfo; -struct timespec; struct __kernel_old_timeval; struct __kernel_timex; struct timezone; struct tms; struct utimbuf; struct mq_attr; -struct compat_stat; struct old_timeval32; struct robust_list_head; struct futex_waitv; --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h @@ -23,9 +23,7 @@ #include struct kobject; -struct module; struct bin_attribute; -enum kobj_ns_type; struct attribute { const char *name; --- a/mm/internal.h +++ b/mm/internal.h @@ -1095,10 +1095,6 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone, /* Flags that allow allocations below the min watermark. */ #define ALLOC_RESERVES (ALLOC_NON_BLOCK|ALLOC_MIN_RESERVE|ALLOC_HIGHATOMIC|ALLOC_OOM) -enum ttu_flags; -struct tlbflush_unmap_batch; - - /* * only for MM internal work items which do not depend on * any allocations or locks which might depend on allocations --- a/mm/shmem.c +++ b/mm/shmem.c @@ -261,7 +261,6 @@ static const struct inode_operations shmem_dir_inode_operations; static const struct inode_operations shmem_special_inode_operations; static const struct vm_operations_struct shmem_vm_ops; static const struct vm_operations_struct shmem_anon_vm_ops; -static struct file_system_type shmem_fs_type; bool shmem_mapping(struct address_space *mapping) {