linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/15] magic-number.rst funeral rites
@ 2022-11-01 23:04 Ahelenia Ziemiańska
  2022-11-01 23:05 ` [PATCH v2 13/15] fcntl: remove FASYNC_MAGIC Ahelenia Ziemiańska
  2022-11-04 18:35 ` [PATCH v2 00/15] magic-number.rst funeral rites Jakub Kicinski
  0 siblings, 2 replies; 3+ messages in thread
From: Ahelenia Ziemiańska @ 2022-11-01 23:04 UTC (permalink / raw)
  Cc: Andrew Morton, Kees Cook, coda, codalist, linux-arm-kernel,
	linux-doc-tw-discuss, linux-doc, linux-fsdevel, linux-hams,
	linux-kernel, linux-mips, linux-scsi, netdev, x86

[-- Attachment #1: Type: text/plain, Size: 4514 bytes --]

This is a follow-up for the 18+1-patch series (
https://lore.kernel.org/linux-kernel/8389a7b85b5c660c6891b1740b5dacc53491a41b.1663280877.git.nabijaczleweli@nabijaczleweli.xyz/
https://lore.kernel.org/linux-kernel/20220927003727.slf4ofb7dgum6apt@tarta.nabijaczleweli.xyz/
) I sent in September, and the same reasoning applies:

The entire file blames back to the start of git
(minus whitespace from the RST translation and a typo fix):
  * there are changelog comments for March 1994 through to Linux 2.5.74
  * struct tty_ldisc is two pointers nowadays, so naturally no magic
  * GDA_MAGIC is defined but unused, and it's been this way
    since start-of-git
  * M3_CARD_MAGIC isn't defined, because
    commit d56b9b9c464a ("[PATCH] The scheduled removal of some OSS
    drivers") removed the entire driver in 2006
  * CS_CARD_MAGIC likewise since
    commit b5d425c97f7d ("more scheduled OSS driver removal") in 2007
  * KMALLOC_MAGIC and VMALLOC_MAGIC were removed in
    commit e38e0cfa48ac ("[ALSA] Remove kmalloc wrappers"),
    six months after start of git
  * SLAB_C_MAGIC has never even appeared in git
    (removed in 2.4.0-test3pre6)
  * &c., &c., &c.

magic-number.rst is a low-value historial relic at best and misleading
cruft at worst.

This latter half cleans out the remaining entries (either by recognising
that they aren't actually magic numbers or by cutting them out entirely)
and inters the file.

amd64 allyesconfig builds; this largely touches code that would be
exceedingly expensive to test (and largely untouched since the git
import), but is very receptive to static analysis.

v2:
  Messages restyled
  Moved printk() in synclink_cs.c became pr_warn
  (__func__ instead of prescribed hard function name per checkpatch.pl)

Ahelenia Ziemiańska (15):
  hamradio: baycom: remove BAYCOM_MAGIC
  hamradio: yam: remove YAM_MAGIC
  pcmcia: synclink_cs: remove MGSLPC_MAGIC
  pcmcia: synclink_cs: remove dead paranoia_check, warn for missing line
  coda: remove CODA_MAGIC
  Documentation: remove PG_MAGIC (not a magic number)
  MIPS: IP27: clean out sn/nmi.h
  MIPS: IP27: remove KV_MAGIC
  x86/APM: remove APM_BIOS_MAGIC
  scsi: acorn: remove QUEUE_MAGIC_{FREE,USED}
  hdlcdrv: remove HDLCDRV_MAGIC
  drivers: net: slip: remove SLIP_MAGIC
  fcntl: remove FASYNC_MAGIC
  scsi: ncr53c8xx: replace CCB_MAGIC with bool busy
  Documentation: remove magic-number.rst

 Documentation/process/index.rst               |  1 -
 Documentation/process/magic-number.rst        | 85 -----------------
 .../translations/it_IT/process/index.rst      |  1 -
 .../it_IT/process/magic-number.rst            | 91 -------------------
 .../translations/zh_CN/process/index.rst      |  1 -
 .../zh_CN/process/magic-number.rst            | 74 ---------------
 .../translations/zh_TW/process/index.rst      |  1 -
 .../zh_TW/process/magic-number.rst            | 77 ----------------
 arch/mips/include/asm/sn/klkernvars.h         |  8 +-
 arch/mips/include/asm/sn/nmi.h                | 60 ------------
 arch/mips/sgi-ip27/ip27-klnuma.c              |  1 -
 arch/x86/kernel/apm_32.c                      |  9 +-
 drivers/char/pcmcia/synclink_cs.c             | 79 +---------------
 drivers/net/hamradio/baycom_epp.c             | 15 +--
 drivers/net/hamradio/baycom_par.c             |  1 -
 drivers/net/hamradio/baycom_ser_fdx.c         |  3 +-
 drivers/net/hamradio/baycom_ser_hdx.c         |  3 +-
 drivers/net/hamradio/hdlcdrv.c                |  9 +-
 drivers/net/hamradio/yam.c                    |  8 +-
 drivers/net/slip/slip.c                       | 11 +--
 drivers/net/slip/slip.h                       |  4 -
 drivers/scsi/arm/queue.c                      | 21 -----
 drivers/scsi/ncr53c8xx.c                      | 25 ++---
 fs/coda/cnode.c                               |  2 +-
 fs/coda/coda_fs_i.h                           |  2 -
 fs/coda/file.c                                |  1 -
 fs/fcntl.c                                    |  6 --
 include/linux/fs.h                            |  3 -
 include/linux/hdlcdrv.h                       |  2 -
 29 files changed, 29 insertions(+), 575 deletions(-)
 delete mode 100644 Documentation/process/magic-number.rst
 delete mode 100644 Documentation/translations/it_IT/process/magic-number.rst
 delete mode 100644 Documentation/translations/zh_CN/process/magic-number.rst
 delete mode 100644 Documentation/translations/zh_TW/process/magic-number.rst

-- 
2.30.2

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2 13/15] fcntl: remove FASYNC_MAGIC
  2022-11-01 23:04 [PATCH v2 00/15] magic-number.rst funeral rites Ahelenia Ziemiańska
@ 2022-11-01 23:05 ` Ahelenia Ziemiańska
  2022-11-04 18:35 ` [PATCH v2 00/15] magic-number.rst funeral rites Jakub Kicinski
  1 sibling, 0 replies; 3+ messages in thread
From: Ahelenia Ziemiańska @ 2022-11-01 23:05 UTC (permalink / raw)
  Cc: Jonathan Corbet, Federico Vaga, Alex Shi, Yanteng Si, Hu Haowen,
	Jeff Layton, Chuck Lever, Alexander Viro, Greg Kroah-Hartman,
	Jiri Slaby, linux-doc, linux-kernel, linux-doc-tw-discuss,
	linux-fsdevel

[-- Attachment #1: Type: text/plain, Size: 5822 bytes --]

We have largely moved away from this approach, and we have better
debugging instrumentation nowadays: kill it.

Link: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
 Documentation/process/magic-number.rst                    | 1 -
 Documentation/translations/it_IT/process/magic-number.rst | 1 -
 Documentation/translations/zh_CN/process/magic-number.rst | 1 -
 Documentation/translations/zh_TW/process/magic-number.rst | 1 -
 fs/fcntl.c                                                | 6 ------
 include/linux/fs.h                                        | 3 ---
 6 files changed, 13 deletions(-)

diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst
index e59c707ec785..6e432917a5a8 100644
--- a/Documentation/process/magic-number.rst
+++ b/Documentation/process/magic-number.rst
@@ -68,6 +68,5 @@ Changelog::
 ===================== ================ ======================== ==========================================
 Magic Name            Number           Structure                File
 ===================== ================ ======================== ==========================================
-FASYNC_MAGIC          0x4601           fasync_struct            ``include/linux/fs.h``
 CCB_MAGIC             0xf2691ad2       ccb                      ``drivers/scsi/ncr53c8xx.c``
 ===================== ================ ======================== ==========================================
diff --git a/Documentation/translations/it_IT/process/magic-number.rst b/Documentation/translations/it_IT/process/magic-number.rst
index 37a539867b6f..7d4c117ac626 100644
--- a/Documentation/translations/it_IT/process/magic-number.rst
+++ b/Documentation/translations/it_IT/process/magic-number.rst
@@ -74,6 +74,5 @@ Registro dei cambiamenti::
 ===================== ================ ======================== ==========================================
 Nome magico           Numero           Struttura                File
 ===================== ================ ======================== ==========================================
-FASYNC_MAGIC          0x4601           fasync_struct            ``include/linux/fs.h``
 CCB_MAGIC             0xf2691ad2       ccb                      ``drivers/scsi/ncr53c8xx.c``
 ===================== ================ ======================== ==========================================
diff --git a/Documentation/translations/zh_CN/process/magic-number.rst b/Documentation/translations/zh_CN/process/magic-number.rst
index 8a3a3e872c52..c17e3f20440a 100644
--- a/Documentation/translations/zh_CN/process/magic-number.rst
+++ b/Documentation/translations/zh_CN/process/magic-number.rst
@@ -57,6 +57,5 @@ Linux 魔术数
 ===================== ================ ======================== ==========================================
 魔术数名              数字             结构                     文件
 ===================== ================ ======================== ==========================================
-FASYNC_MAGIC          0x4601           fasync_struct            ``include/linux/fs.h``
 CCB_MAGIC             0xf2691ad2       ccb                      ``drivers/scsi/ncr53c8xx.c``
 ===================== ================ ======================== ==========================================
diff --git a/Documentation/translations/zh_TW/process/magic-number.rst b/Documentation/translations/zh_TW/process/magic-number.rst
index 7ace7834f7f9..e2eeb74e7192 100644
--- a/Documentation/translations/zh_TW/process/magic-number.rst
+++ b/Documentation/translations/zh_TW/process/magic-number.rst
@@ -60,6 +60,5 @@ Linux 魔術數
 ===================== ================ ======================== ==========================================
 魔術數名              數字             結構                     文件
 ===================== ================ ======================== ==========================================
-FASYNC_MAGIC          0x4601           fasync_struct            ``include/linux/fs.h``
 CCB_MAGIC             0xf2691ad2       ccb                      ``drivers/scsi/ncr53c8xx.c``
 ===================== ================ ======================== ==========================================
diff --git a/fs/fcntl.c b/fs/fcntl.c
index 146c9ab0cd4b..e366a3804108 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -924,7 +924,6 @@ struct fasync_struct *fasync_insert_entry(int fd, struct file *filp, struct fasy
 	}
 
 	rwlock_init(&new->fa_lock);
-	new->magic = FASYNC_MAGIC;
 	new->fa_file = filp;
 	new->fa_fd = fd;
 	new->fa_next = *fapp;
@@ -988,11 +987,6 @@ static void kill_fasync_rcu(struct fasync_struct *fa, int sig, int band)
 		struct fown_struct *fown;
 		unsigned long flags;
 
-		if (fa->magic != FASYNC_MAGIC) {
-			printk(KERN_ERR "kill_fasync: bad magic number in "
-			       "fasync_struct!\n");
-			return;
-		}
 		read_lock_irqsave(&fa->fa_lock, flags);
 		if (fa->fa_file) {
 			fown = &fa->fa_file->f_owner;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index e654435f1651..acfd5db5341a 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1345,15 +1345,12 @@ static inline int locks_lock_file_wait(struct file *filp, struct file_lock *fl)
 
 struct fasync_struct {
 	rwlock_t		fa_lock;
-	int			magic;
 	int			fa_fd;
 	struct fasync_struct	*fa_next; /* singly linked list */
 	struct file		*fa_file;
 	struct rcu_head		fa_rcu;
 };
 
-#define FASYNC_MAGIC 0x4601
-
 /* SMP safe fasync helpers: */
 extern int fasync_helper(int, struct file *, int, struct fasync_struct **);
 extern struct fasync_struct *fasync_insert_entry(int, struct file *, struct fasync_struct **, struct fasync_struct *);
-- 
2.30.2

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 00/15] magic-number.rst funeral rites
  2022-11-01 23:04 [PATCH v2 00/15] magic-number.rst funeral rites Ahelenia Ziemiańska
  2022-11-01 23:05 ` [PATCH v2 13/15] fcntl: remove FASYNC_MAGIC Ahelenia Ziemiańska
@ 2022-11-04 18:35 ` Jakub Kicinski
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2022-11-04 18:35 UTC (permalink / raw)
  To: Ahelenia Ziemiańska
  Cc: Andrew Morton, Kees Cook, coda, codalist, linux-arm-kernel,
	linux-doc-tw-discuss, linux-doc, linux-fsdevel, linux-hams,
	linux-kernel, linux-mips, linux-scsi, netdev, x86

On Wed, 2 Nov 2022 00:04:54 +0100 Ahelenia Ziemiańska wrote:
> This is a follow-up for the 18+1-patch series (
> https://lore.kernel.org/linux-kernel/8389a7b85b5c660c6891b1740b5dacc53491a41b.1663280877.git.nabijaczleweli@nabijaczleweli.xyz/
> https://lore.kernel.org/linux-kernel/20220927003727.slf4ofb7dgum6apt@tarta.nabijaczleweli.xyz/
> ) I sent in September, and the same reasoning applies:

No idea how you want this to get merged, but FWIW you can add my

Acked-by: Jakub Kicinski <kuba@kernel.org>

to patches 1, 2, 11 and 12.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-04 18:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-01 23:04 [PATCH v2 00/15] magic-number.rst funeral rites Ahelenia Ziemiańska
2022-11-01 23:05 ` [PATCH v2 13/15] fcntl: remove FASYNC_MAGIC Ahelenia Ziemiańska
2022-11-04 18:35 ` [PATCH v2 00/15] magic-number.rst funeral rites Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).