netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/15] hamradio: baycom: remove BAYCOM_MAGIC
@ 2022-10-26 22:42 наб
  2022-10-26 22:42 ` [PATCH 02/15] hamradio: yam: remove YAM_MAGIC наб
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: наб @ 2022-10-26 22:42 UTC (permalink / raw)
  Cc: Jonathan Corbet, Federico Vaga, Alex Shi, Yanteng Si, Hu Haowen,
	Thomas Sailer, David S. Miller, Eric Dumazet, Jakub Kiciński,
	Paolo Abeni, Greg Kroah-Hartman, Jiri Slaby, linux-doc,
	linux-kernel, linux-doc-tw-discuss, linux-hams, netdev

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

Since defanging in v2.6.12-rc1 it's set exactly once per port on probe
and checked exactly once per port on unload: it's useless. Kill it.

Notably, magic-number.rst has never had the right value for it with the
new-in-2.1.105 network-based driver

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Ref: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/
---
 Documentation/process/magic-number.rst            |  1 -
 .../translations/it_IT/process/magic-number.rst   |  1 -
 .../translations/zh_CN/process/magic-number.rst   |  1 -
 .../translations/zh_TW/process/magic-number.rst   |  1 -
 drivers/net/hamradio/baycom_epp.c                 | 15 ++-------------
 5 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst
index 64b5948fc1d4..87353e0207c1 100644
--- a/Documentation/process/magic-number.rst
+++ b/Documentation/process/magic-number.rst
@@ -73,7 +73,6 @@ APM_BIOS_MAGIC        0x4101           apm_user                 ``arch/x86/kerne
 FASYNC_MAGIC          0x4601           fasync_struct            ``include/linux/fs.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
 MGSLPC_MAGIC          0x5402           mgslpc_info              ``drivers/char/pcmcia/synclink_cs.c``
-BAYCOM_MAGIC          0x19730510       baycom_state             ``drivers/net/baycom_epp.c``
 HDLCDRV_MAGIC         0x5ac6e778       hdlcdrv_state            ``include/linux/hdlcdrv.h``
 KV_MAGIC              0x5f4b565f       kernel_vars_s            ``arch/mips/include/asm/sn/klkernvars.h``
 CODA_MAGIC            0xC0DAC0DA       coda_file_info           ``fs/coda/coda_fs_i.h``
diff --git a/Documentation/translations/it_IT/process/magic-number.rst b/Documentation/translations/it_IT/process/magic-number.rst
index 02eb7eb2448e..a96712bd8a68 100644
--- a/Documentation/translations/it_IT/process/magic-number.rst
+++ b/Documentation/translations/it_IT/process/magic-number.rst
@@ -79,7 +79,6 @@ APM_BIOS_MAGIC        0x4101           apm_user                 ``arch/x86/kerne
 FASYNC_MAGIC          0x4601           fasync_struct            ``include/linux/fs.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
 MGSLPC_MAGIC          0x5402           mgslpc_info              ``drivers/char/pcmcia/synclink_cs.c``
-BAYCOM_MAGIC          0x19730510       baycom_state             ``drivers/net/baycom_epp.c``
 HDLCDRV_MAGIC         0x5ac6e778       hdlcdrv_state            ``include/linux/hdlcdrv.h``
 KV_MAGIC              0x5f4b565f       kernel_vars_s            ``arch/mips/include/asm/sn/klkernvars.h``
 CODA_MAGIC            0xC0DAC0DA       coda_file_info           ``fs/coda/coda_fs_i.h``
diff --git a/Documentation/translations/zh_CN/process/magic-number.rst b/Documentation/translations/zh_CN/process/magic-number.rst
index 0617ce125e12..44f3a29fce57 100644
--- a/Documentation/translations/zh_CN/process/magic-number.rst
+++ b/Documentation/translations/zh_CN/process/magic-number.rst
@@ -62,7 +62,6 @@ APM_BIOS_MAGIC        0x4101           apm_user                 ``arch/x86/kerne
 FASYNC_MAGIC          0x4601           fasync_struct            ``include/linux/fs.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
 MGSLPC_MAGIC          0x5402           mgslpc_info              ``drivers/char/pcmcia/synclink_cs.c``
-BAYCOM_MAGIC          0x19730510       baycom_state             ``drivers/net/baycom_epp.c``
 HDLCDRV_MAGIC         0x5ac6e778       hdlcdrv_state            ``include/linux/hdlcdrv.h``
 KV_MAGIC              0x5f4b565f       kernel_vars_s            ``arch/mips/include/asm/sn/klkernvars.h``
 CODA_MAGIC            0xC0DAC0DA       coda_file_info           ``fs/coda/coda_fs_i.h``
diff --git a/Documentation/translations/zh_TW/process/magic-number.rst b/Documentation/translations/zh_TW/process/magic-number.rst
index f3f7082e17c6..0fde3183e82a 100644
--- a/Documentation/translations/zh_TW/process/magic-number.rst
+++ b/Documentation/translations/zh_TW/process/magic-number.rst
@@ -65,7 +65,6 @@ APM_BIOS_MAGIC        0x4101           apm_user                 ``arch/x86/kerne
 FASYNC_MAGIC          0x4601           fasync_struct            ``include/linux/fs.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
 MGSLPC_MAGIC          0x5402           mgslpc_info              ``drivers/char/pcmcia/synclink_cs.c``
-BAYCOM_MAGIC          0x19730510       baycom_state             ``drivers/net/baycom_epp.c``
 HDLCDRV_MAGIC         0x5ac6e778       hdlcdrv_state            ``include/linux/hdlcdrv.h``
 KV_MAGIC              0x5f4b565f       kernel_vars_s            ``arch/mips/include/asm/sn/klkernvars.h``
 CODA_MAGIC            0xC0DAC0DA       coda_file_info           ``fs/coda/coda_fs_i.h``
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c
index 791b4a53d69f..8f018703e74d 100644
--- a/drivers/net/hamradio/baycom_epp.c
+++ b/drivers/net/hamradio/baycom_epp.c
@@ -45,13 +45,9 @@
 /* --------------------------------------------------------------------- */
 
 #define BAYCOM_DEBUG
-#define BAYCOM_MAGIC 19730510
 
 /* --------------------------------------------------------------------- */
 
-static const char paranoia_str[] = KERN_ERR 
-	"baycom_epp: bad magic number for hdlcdrv_state struct in routine %s\n";
-
 static const char bc_drvname[] = "baycom_epp";
 static const char bc_drvinfo[] = KERN_INFO "baycom_epp: (C) 1998-2000 Thomas Sailer, HB9JNX/AE4WA\n"
 "baycom_epp: version 0.7\n";
@@ -152,8 +148,6 @@ static struct net_device *baycom_device[NR_PORTS];
  */
 
 struct baycom_state {
-	int magic;
-
         struct pardevice *pdev;
 	struct net_device *dev;
 	unsigned int work_running;
@@ -1210,7 +1204,6 @@ static void __init baycom_epp_dev_setup(struct net_device *dev)
 	 * initialize part of the baycom_state struct
 	 */
 	bc->dev = dev;
-	bc->magic = BAYCOM_MAGIC;
 	bc->cfg.fclk = 19666600;
 	bc->cfg.bps = 9600;
 	/*
@@ -1279,12 +1272,8 @@ static void __exit cleanup_baycomepp(void)
 		struct net_device *dev = baycom_device[i];
 
 		if (dev) {
-			struct baycom_state *bc = netdev_priv(dev);
-			if (bc->magic == BAYCOM_MAGIC) {
-				unregister_netdev(dev);
-				free_netdev(dev);
-			} else
-				printk(paranoia_str, "cleanup_module");
+			unregister_netdev(dev);
+			free_netdev(dev);
 		}
 	}
 	parport_unregister_driver(&baycom_epp_par_driver);
-- 
2.30.2

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

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

* [PATCH 02/15] hamradio: yam: remove YAM_MAGIC
  2022-10-26 22:42 [PATCH 01/15] hamradio: baycom: remove BAYCOM_MAGIC наб
@ 2022-10-26 22:42 ` наб
  2022-10-28 13:19   ` Bagas Sanjaya
  2022-10-26 22:43 ` [PATCH 11/15] hdlcdrv: remove HDLCDRV_MAGIC наб
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 17+ messages in thread
From: наб @ 2022-10-26 22:42 UTC (permalink / raw)
  Cc: Jonathan Corbet, Federico Vaga, Alex Shi, Yanteng Si, Hu Haowen,
	Jean-Paul Roubelat, David S. Miller, Eric Dumazet,
	Jakub Kiciński, Paolo Abeni, Greg Kroah-Hartman, Jiri Slaby,
	linux-doc, linux-kernel, linux-doc-tw-discuss, linux-hams, netdev

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

This is checked inconsistently, only in contexts following directly
from the module init, and returns an error to userspace/ignores
the condition entirely, rather than yielding remotely-useful diagnostics

This is cruft, and we have better debugging tooling nowadays: kill it

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Ref: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/
---
 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 -
 drivers/net/hamradio/yam.c                                | 8 +-------
 5 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst
index 87353e0207c1..a4414b7e15aa 100644
--- a/Documentation/process/magic-number.rst
+++ b/Documentation/process/magic-number.rst
@@ -76,7 +76,6 @@ MGSLPC_MAGIC          0x5402           mgslpc_info              ``drivers/char/p
 HDLCDRV_MAGIC         0x5ac6e778       hdlcdrv_state            ``include/linux/hdlcdrv.h``
 KV_MAGIC              0x5f4b565f       kernel_vars_s            ``arch/mips/include/asm/sn/klkernvars.h``
 CODA_MAGIC            0xC0DAC0DA       coda_file_info           ``fs/coda/coda_fs_i.h``
-YAM_MAGIC             0xF10A7654       yam_port                 ``drivers/net/hamradio/yam.c``
 CCB_MAGIC             0xf2691ad2       ccb                      ``drivers/scsi/ncr53c8xx.c``
 QUEUE_MAGIC_FREE      0xf7e1c9a3       queue_entry              ``drivers/scsi/arm/queue.c``
 QUEUE_MAGIC_USED      0xf7e1cc33       queue_entry              ``drivers/scsi/arm/queue.c``
diff --git a/Documentation/translations/it_IT/process/magic-number.rst b/Documentation/translations/it_IT/process/magic-number.rst
index a96712bd8a68..f51c5ef9d93f 100644
--- a/Documentation/translations/it_IT/process/magic-number.rst
+++ b/Documentation/translations/it_IT/process/magic-number.rst
@@ -82,7 +82,6 @@ MGSLPC_MAGIC          0x5402           mgslpc_info              ``drivers/char/p
 HDLCDRV_MAGIC         0x5ac6e778       hdlcdrv_state            ``include/linux/hdlcdrv.h``
 KV_MAGIC              0x5f4b565f       kernel_vars_s            ``arch/mips/include/asm/sn/klkernvars.h``
 CODA_MAGIC            0xC0DAC0DA       coda_file_info           ``fs/coda/coda_fs_i.h``
-YAM_MAGIC             0xF10A7654       yam_port                 ``drivers/net/hamradio/yam.c``
 CCB_MAGIC             0xf2691ad2       ccb                      ``drivers/scsi/ncr53c8xx.c``
 QUEUE_MAGIC_FREE      0xf7e1c9a3       queue_entry              ``drivers/scsi/arm/queue.c``
 QUEUE_MAGIC_USED      0xf7e1cc33       queue_entry              ``drivers/scsi/arm/queue.c``
diff --git a/Documentation/translations/zh_CN/process/magic-number.rst b/Documentation/translations/zh_CN/process/magic-number.rst
index 44f3a29fce57..3b53bd67e41b 100644
--- a/Documentation/translations/zh_CN/process/magic-number.rst
+++ b/Documentation/translations/zh_CN/process/magic-number.rst
@@ -65,7 +65,6 @@ MGSLPC_MAGIC          0x5402           mgslpc_info              ``drivers/char/p
 HDLCDRV_MAGIC         0x5ac6e778       hdlcdrv_state            ``include/linux/hdlcdrv.h``
 KV_MAGIC              0x5f4b565f       kernel_vars_s            ``arch/mips/include/asm/sn/klkernvars.h``
 CODA_MAGIC            0xC0DAC0DA       coda_file_info           ``fs/coda/coda_fs_i.h``
-YAM_MAGIC             0xF10A7654       yam_port                 ``drivers/net/hamradio/yam.c``
 CCB_MAGIC             0xf2691ad2       ccb                      ``drivers/scsi/ncr53c8xx.c``
 QUEUE_MAGIC_FREE      0xf7e1c9a3       queue_entry              ``drivers/scsi/arm/queue.c``
 QUEUE_MAGIC_USED      0xf7e1cc33       queue_entry              ``drivers/scsi/arm/queue.c``
diff --git a/Documentation/translations/zh_TW/process/magic-number.rst b/Documentation/translations/zh_TW/process/magic-number.rst
index 0fde3183e82a..7d176a87ec3c 100644
--- a/Documentation/translations/zh_TW/process/magic-number.rst
+++ b/Documentation/translations/zh_TW/process/magic-number.rst
@@ -68,7 +68,6 @@ MGSLPC_MAGIC          0x5402           mgslpc_info              ``drivers/char/p
 HDLCDRV_MAGIC         0x5ac6e778       hdlcdrv_state            ``include/linux/hdlcdrv.h``
 KV_MAGIC              0x5f4b565f       kernel_vars_s            ``arch/mips/include/asm/sn/klkernvars.h``
 CODA_MAGIC            0xC0DAC0DA       coda_file_info           ``fs/coda/coda_fs_i.h``
-YAM_MAGIC             0xF10A7654       yam_port                 ``drivers/net/hamradio/yam.c``
 CCB_MAGIC             0xf2691ad2       ccb                      ``drivers/scsi/ncr53c8xx.c``
 QUEUE_MAGIC_FREE      0xf7e1c9a3       queue_entry              ``drivers/scsi/arm/queue.c``
 QUEUE_MAGIC_USED      0xf7e1cc33       queue_entry              ``drivers/scsi/arm/queue.c``
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index 2ed2f836f09a..0f43411a6ca5 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -73,7 +73,6 @@ static const char yam_drvinfo[] __initconst = KERN_INFO \
 #define YAM_1200	2
 
 #define NR_PORTS	4
-#define YAM_MAGIC	0xF10A7654
 
 /* Transmitter states */
 
@@ -94,7 +93,6 @@ static const char yam_drvinfo[] __initconst = KERN_INFO \
 #define DEFAULT_PERS	64			/* 0->255 */
 
 struct yam_port {
-	int magic;
 	int bitrate;
 	int baudrate;
 	int iobase;
@@ -604,7 +602,7 @@ static void yam_arbitrate(struct net_device *dev)
 {
 	struct yam_port *yp = netdev_priv(dev);
 
-	if (yp->magic != YAM_MAGIC || yp->tx_state != TX_OFF ||
+	if (yp->tx_state != TX_OFF ||
 	    skb_queue_empty(&yp->send_queue))
 		return;
 	/* tx_state is TX_OFF and there is data to send */
@@ -930,9 +928,6 @@ static int yam_siocdevprivate(struct net_device *dev, struct ifreq *ifr, void __
 	if (copy_from_user(&ioctl_cmd, data, sizeof(int)))
 		return -EFAULT;
 
-	if (yp->magic != YAM_MAGIC)
-		return -EINVAL;
-
 	if (!capable(CAP_NET_ADMIN))
 		return -EPERM;
 
@@ -1079,7 +1074,6 @@ static void yam_setup(struct net_device *dev)
 {
 	struct yam_port *yp = netdev_priv(dev);
 
-	yp->magic = YAM_MAGIC;
 	yp->bitrate = DEFAULT_BITRATE;
 	yp->baudrate = DEFAULT_BITRATE * 2;
 	yp->iobase = 0;
-- 
2.30.2

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

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

* [PATCH 11/15] hdlcdrv: remove HDLCDRV_MAGIC
  2022-10-26 22:42 [PATCH 01/15] hamradio: baycom: remove BAYCOM_MAGIC наб
  2022-10-26 22:42 ` [PATCH 02/15] hamradio: yam: remove YAM_MAGIC наб
@ 2022-10-26 22:43 ` наб
  2022-10-28 13:54   ` Bagas Sanjaya
  2022-10-26 22:43 ` [PATCH 12/15] drivers: net: slip: remove SLIP_MAGIC наб
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 17+ messages in thread
From: наб @ 2022-10-26 22:43 UTC (permalink / raw)
  Cc: Jonathan Corbet, Federico Vaga, Alex Shi, Yanteng Si, Hu Haowen,
	Thomas Sailer, David S. Miller, Eric Dumazet, Jakub Kiciński,
	Paolo Abeni, Greg Kroah-Hartman, Jiri Slaby, Jason A. Donenfeld,
	Kees Cook, Marc Kleine-Budde, Wolfram Sang, linux-doc,
	linux-kernel, linux-doc-tw-discuss, linux-hams, netdev

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

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

Additionally, ~half HDLCDRV_MAGIC checks just early-exit instead
of noting the bug, so they're detrimental, if anything

Ref: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
 Documentation/process/magic-number.rst                   | 1 -
 .../translations/it_IT/process/magic-number.rst          | 1 -
 .../translations/zh_CN/process/magic-number.rst          | 1 -
 .../translations/zh_TW/process/magic-number.rst          | 1 -
 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 +++------
 include/linux/hdlcdrv.h                                  | 2 --
 9 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst
index c1c68c713cbc..3b3e607e1cbc 100644
--- a/Documentation/process/magic-number.rst
+++ b/Documentation/process/magic-number.rst
@@ -70,6 +70,5 @@ Magic Name            Number           Structure                File
 ===================== ================ ======================== ==========================================
 FASYNC_MAGIC          0x4601           fasync_struct            ``include/linux/fs.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
-HDLCDRV_MAGIC         0x5ac6e778       hdlcdrv_state            ``include/linux/hdlcdrv.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 5b609ca78a14..e8c659b6a743 100644
--- a/Documentation/translations/it_IT/process/magic-number.rst
+++ b/Documentation/translations/it_IT/process/magic-number.rst
@@ -76,6 +76,5 @@ Nome magico           Numero           Struttura                File
 ===================== ================ ======================== ==========================================
 FASYNC_MAGIC          0x4601           fasync_struct            ``include/linux/fs.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
-HDLCDRV_MAGIC         0x5ac6e778       hdlcdrv_state            ``include/linux/hdlcdrv.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 ab4d4e32b61f..2105af32187c 100644
--- a/Documentation/translations/zh_CN/process/magic-number.rst
+++ b/Documentation/translations/zh_CN/process/magic-number.rst
@@ -59,6 +59,5 @@ Linux 魔术数
 ===================== ================ ======================== ==========================================
 FASYNC_MAGIC          0x4601           fasync_struct            ``include/linux/fs.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
-HDLCDRV_MAGIC         0x5ac6e778       hdlcdrv_state            ``include/linux/hdlcdrv.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 a6131d978189..793a0ae9fb7c 100644
--- a/Documentation/translations/zh_TW/process/magic-number.rst
+++ b/Documentation/translations/zh_TW/process/magic-number.rst
@@ -62,6 +62,5 @@ Linux 魔術數
 ===================== ================ ======================== ==========================================
 FASYNC_MAGIC          0x4601           fasync_struct            ``include/linux/fs.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
-HDLCDRV_MAGIC         0x5ac6e778       hdlcdrv_state            ``include/linux/hdlcdrv.h``
 CCB_MAGIC             0xf2691ad2       ccb                      ``drivers/scsi/ncr53c8xx.c``
 ===================== ================ ======================== ==========================================
diff --git a/drivers/net/hamradio/baycom_par.c b/drivers/net/hamradio/baycom_par.c
index fd7da5bb1fa5..e1cf3ed42df6 100644
--- a/drivers/net/hamradio/baycom_par.c
+++ b/drivers/net/hamradio/baycom_par.c
@@ -418,7 +418,6 @@ static int baycom_ioctl(struct net_device *dev, void __user *data,
 		return -EINVAL;
 
 	bc = netdev_priv(dev);
-	BUG_ON(bc->hdrv.magic != HDLCDRV_MAGIC);
 
 	if (cmd != SIOCDEVPRIVATE)
 		return -ENOIOCTLCMD;
diff --git a/drivers/net/hamradio/baycom_ser_fdx.c b/drivers/net/hamradio/baycom_ser_fdx.c
index 646f605e358f..65113cb6de8d 100644
--- a/drivers/net/hamradio/baycom_ser_fdx.c
+++ b/drivers/net/hamradio/baycom_ser_fdx.c
@@ -252,7 +252,7 @@ static irqreturn_t ser12_interrupt(int irq, void *dev_id)
 	unsigned char iir, msr;
 	unsigned int txcount = 0;
 
-	if (!bc || bc->hdrv.magic != HDLCDRV_MAGIC)
+	if (!bc)
 		return IRQ_NONE;
 	/* fast way out for shared irq */
 	if ((iir = inb(IIR(dev->base_addr))) & 1) 	
@@ -507,7 +507,6 @@ static int baycom_ioctl(struct net_device *dev, void __user *data,
 		return -EINVAL;
 
 	bc = netdev_priv(dev);
-	BUG_ON(bc->hdrv.magic != HDLCDRV_MAGIC);
 
 	if (cmd != SIOCDEVPRIVATE)
 		return -ENOIOCTLCMD;
diff --git a/drivers/net/hamradio/baycom_ser_hdx.c b/drivers/net/hamradio/baycom_ser_hdx.c
index 5d1ab4840753..df33e5cdb5c2 100644
--- a/drivers/net/hamradio/baycom_ser_hdx.c
+++ b/drivers/net/hamradio/baycom_ser_hdx.c
@@ -365,7 +365,7 @@ static irqreturn_t ser12_interrupt(int irq, void *dev_id)
 	struct baycom_state *bc = netdev_priv(dev);
 	unsigned char iir;
 
-	if (!dev || !bc || bc->hdrv.magic != HDLCDRV_MAGIC)
+	if (!dev || !bc)
 		return IRQ_NONE;
 	/* fast way out */
 	if ((iir = inb(IIR(dev->base_addr))) & 1)
@@ -561,7 +561,6 @@ static int baycom_ioctl(struct net_device *dev, void __user *data,
 		return -EINVAL;
 
 	bc = netdev_priv(dev);
-	BUG_ON(bc->hdrv.magic != HDLCDRV_MAGIC);
 
 	if (cmd != SIOCDEVPRIVATE)
 		return -ENOIOCTLCMD;
diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c
index 2263029d1a20..60abd6008cc7 100644
--- a/drivers/net/hamradio/hdlcdrv.c
+++ b/drivers/net/hamradio/hdlcdrv.c
@@ -158,7 +158,7 @@ void hdlcdrv_receiver(struct net_device *dev, struct hdlcdrv_state *s)
 	int i;
 	unsigned int mask1, mask2, mask3, mask4, mask5, mask6, word;
 	
-	if (!s || s->magic != HDLCDRV_MAGIC) 
+	if (!s)
 		return;
 	if (test_and_set_bit(0, &s->hdlcrx.in_hdlc_rx))
 		return;
@@ -257,7 +257,7 @@ void hdlcdrv_transmitter(struct net_device *dev, struct hdlcdrv_state *s)
 	struct sk_buff *skb;
 	int pkt_len;
 
-	if (!s || s->magic != HDLCDRV_MAGIC) 
+	if (!s)
 		return;
 	if (test_and_set_bit(0, &s->hdlctx.in_hdlc_tx))
 		return;
@@ -364,7 +364,7 @@ static void start_tx(struct net_device *dev, struct hdlcdrv_state *s)
 
 void hdlcdrv_arbitrate(struct net_device *dev, struct hdlcdrv_state *s)
 {
-	if (!s || s->magic != HDLCDRV_MAGIC || s->hdlctx.ptt || !s->skb) 
+	if (!s || s->hdlctx.ptt || !s->skb)
 		return;
 	if (s->ch_params.fulldup) {
 		start_tx(dev, s);
@@ -701,7 +701,6 @@ struct net_device *hdlcdrv_register(const struct hdlcdrv_ops *ops,
 	 * initialize part of the hdlcdrv_state struct
 	 */
 	s = netdev_priv(dev);
-	s->magic = HDLCDRV_MAGIC;
 	s->ops = ops;
 	dev->base_addr = baseaddr;
 	dev->irq = irq;
@@ -723,8 +722,6 @@ void hdlcdrv_unregister(struct net_device *dev)
 {
 	struct hdlcdrv_state *s = netdev_priv(dev);
 
-	BUG_ON(s->magic != HDLCDRV_MAGIC);
-
 	if (s->opened && s->ops->close)
 		s->ops->close(dev);
 	unregister_netdev(dev);
diff --git a/include/linux/hdlcdrv.h b/include/linux/hdlcdrv.h
index 5d70c3f98f5b..809ad0f5c99c 100644
--- a/include/linux/hdlcdrv.h
+++ b/include/linux/hdlcdrv.h
@@ -13,7 +13,6 @@
 #include <linux/spinlock.h>
 #include <uapi/linux/hdlcdrv.h>
 
-#define HDLCDRV_MAGIC      0x5ac6e778
 #define HDLCDRV_HDLCBUFFER  32 /* should be a power of 2 for speed reasons */
 #define HDLCDRV_BITBUFFER  256 /* should be a power of 2 for speed reasons */
 #undef HDLCDRV_LOOPBACK  /* define for HDLC debugging purposes */
@@ -84,7 +83,6 @@ struct hdlcdrv_ops {
 };
 
 struct hdlcdrv_state {
-	int magic;
 	int opened;
 
 	const struct hdlcdrv_ops *ops;
-- 
2.30.2

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

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

* [PATCH 12/15] drivers: net: slip: remove SLIP_MAGIC
  2022-10-26 22:42 [PATCH 01/15] hamradio: baycom: remove BAYCOM_MAGIC наб
  2022-10-26 22:42 ` [PATCH 02/15] hamradio: yam: remove YAM_MAGIC наб
  2022-10-26 22:43 ` [PATCH 11/15] hdlcdrv: remove HDLCDRV_MAGIC наб
@ 2022-10-26 22:43 ` наб
  2022-10-27 13:11   ` Oliver Hartkopp
  2022-10-28 13:57   ` Bagas Sanjaya
  2022-10-27  1:37 ` [PATCH 01/15] hamradio: baycom: remove BAYCOM_MAGIC Jakub Kicinski
  2022-10-28 13:13 ` Bagas Sanjaya
  4 siblings, 2 replies; 17+ messages in thread
From: наб @ 2022-10-26 22:43 UTC (permalink / raw)
  Cc: Jonathan Corbet, Federico Vaga, Alex Shi, Yanteng Si, Hu Haowen,
	David S. Miller, Eric Dumazet, Jakub Kiciński, Paolo Abeni,
	Greg Kroah-Hartman, Jiri Slaby, Marc Kleine-Budde,
	Oliver Hartkopp, Sebastian Andrzej Siewior, Duoming Zhou,
	Huang Pei, linux-doc, linux-kernel, linux-doc-tw-discuss, netdev

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

According to Greg, in the context of magic numbers as defined in
magic-number.rst, "the tty layer should not need this and I'll gladly
take patches"

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

Additionally, all SLIP_MAGIC checks just early-exit instead
of noting the bug, so they're detrimental, if anything

Ref: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
 Documentation/process/magic-number.rst                |  1 -
 .../translations/it_IT/process/magic-number.rst       |  1 -
 .../translations/zh_CN/process/magic-number.rst       |  1 -
 .../translations/zh_TW/process/magic-number.rst       |  1 -
 drivers/net/slip/slip.c                               | 11 +++++------
 drivers/net/slip/slip.h                               |  4 ----
 6 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst
index 3b3e607e1cbc..e59c707ec785 100644
--- a/Documentation/process/magic-number.rst
+++ b/Documentation/process/magic-number.rst
@@ -69,6 +69,5 @@ Changelog::
 Magic Name            Number           Structure                File
 ===================== ================ ======================== ==========================================
 FASYNC_MAGIC          0x4601           fasync_struct            ``include/linux/fs.h``
-SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.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 e8c659b6a743..37a539867b6f 100644
--- a/Documentation/translations/it_IT/process/magic-number.rst
+++ b/Documentation/translations/it_IT/process/magic-number.rst
@@ -75,6 +75,5 @@ Registro dei cambiamenti::
 Nome magico           Numero           Struttura                File
 ===================== ================ ======================== ==========================================
 FASYNC_MAGIC          0x4601           fasync_struct            ``include/linux/fs.h``
-SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.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 2105af32187c..8a3a3e872c52 100644
--- a/Documentation/translations/zh_CN/process/magic-number.rst
+++ b/Documentation/translations/zh_CN/process/magic-number.rst
@@ -58,6 +58,5 @@ Linux 魔术数
 魔术数名              数字             结构                     文件
 ===================== ================ ======================== ==========================================
 FASYNC_MAGIC          0x4601           fasync_struct            ``include/linux/fs.h``
-SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.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 793a0ae9fb7c..7ace7834f7f9 100644
--- a/Documentation/translations/zh_TW/process/magic-number.rst
+++ b/Documentation/translations/zh_TW/process/magic-number.rst
@@ -61,6 +61,5 @@ Linux 魔術數
 魔術數名              數字             結構                     文件
 ===================== ================ ======================== ==========================================
 FASYNC_MAGIC          0x4601           fasync_struct            ``include/linux/fs.h``
-SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
 CCB_MAGIC             0xf2691ad2       ccb                      ``drivers/scsi/ncr53c8xx.c``
 ===================== ================ ======================== ==========================================
diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c
index 6865d32270e5..95f5c79772e7 100644
--- a/drivers/net/slip/slip.c
+++ b/drivers/net/slip/slip.c
@@ -426,7 +426,7 @@ static void slip_transmit(struct work_struct *work)
 
 	spin_lock_bh(&sl->lock);
 	/* First make sure we're connected. */
-	if (!sl->tty || sl->magic != SLIP_MAGIC || !netif_running(sl->dev)) {
+	if (!sl->tty || !netif_running(sl->dev)) {
 		spin_unlock_bh(&sl->lock);
 		return;
 	}
@@ -690,7 +690,7 @@ static void slip_receive_buf(struct tty_struct *tty, const unsigned char *cp,
 {
 	struct slip *sl = tty->disc_data;
 
-	if (!sl || sl->magic != SLIP_MAGIC || !netif_running(sl->dev))
+	if (!sl || !netif_running(sl->dev))
 		return;
 
 	/* Read the characters out of the buffer */
@@ -761,7 +761,6 @@ static struct slip *sl_alloc(void)
 	sl = netdev_priv(dev);
 
 	/* Initialize channel control data */
-	sl->magic       = SLIP_MAGIC;
 	sl->dev	      	= dev;
 	spin_lock_init(&sl->lock);
 	INIT_WORK(&sl->tx_work, slip_transmit);
@@ -809,7 +808,7 @@ static int slip_open(struct tty_struct *tty)
 
 	err = -EEXIST;
 	/* First make sure we're not already connected. */
-	if (sl && sl->magic == SLIP_MAGIC)
+	if (sl)
 		goto err_exit;
 
 	/* OK.  Find a free SLIP channel to use. */
@@ -886,7 +885,7 @@ static void slip_close(struct tty_struct *tty)
 	struct slip *sl = tty->disc_data;
 
 	/* First make sure we're connected. */
-	if (!sl || sl->magic != SLIP_MAGIC || sl->tty != tty)
+	if (!sl || sl->tty != tty)
 		return;
 
 	spin_lock_bh(&sl->lock);
@@ -1080,7 +1079,7 @@ static int slip_ioctl(struct tty_struct *tty, unsigned int cmd,
 	int __user *p = (int __user *)arg;
 
 	/* First make sure we're connected. */
-	if (!sl || sl->magic != SLIP_MAGIC)
+	if (!sl)
 		return -EINVAL;
 
 	switch (cmd) {
diff --git a/drivers/net/slip/slip.h b/drivers/net/slip/slip.h
index 3d7f88b330c1..d7dbedd27669 100644
--- a/drivers/net/slip/slip.h
+++ b/drivers/net/slip/slip.h
@@ -50,8 +50,6 @@
 
 
 struct slip {
-  int			magic;
-
   /* Various fields. */
   struct tty_struct	*tty;		/* ptr to TTY structure		*/
   struct net_device	*dev;		/* easy for intr handling	*/
@@ -100,6 +98,4 @@ struct slip {
 #endif
 };
 
-#define SLIP_MAGIC 0x5302
-
 #endif	/* _LINUX_SLIP.H */
-- 
2.30.2

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

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

* Re: [PATCH 01/15] hamradio: baycom: remove BAYCOM_MAGIC
  2022-10-26 22:42 [PATCH 01/15] hamradio: baycom: remove BAYCOM_MAGIC наб
                   ` (2 preceding siblings ...)
  2022-10-26 22:43 ` [PATCH 12/15] drivers: net: slip: remove SLIP_MAGIC наб
@ 2022-10-27  1:37 ` Jakub Kicinski
  2022-10-28  1:54   ` Bagas Sanjaya
  2022-10-28 13:13 ` Bagas Sanjaya
  4 siblings, 1 reply; 17+ messages in thread
From: Jakub Kicinski @ 2022-10-27  1:37 UTC (permalink / raw)
  To: наб
  Cc: Jonathan Corbet, Federico Vaga, Alex Shi, Yanteng Si, Hu Haowen,
	Thomas Sailer, David S. Miller, Eric Dumazet, Paolo Abeni,
	Greg Kroah-Hartman, Jiri Slaby, linux-doc, linux-kernel,
	linux-doc-tw-discuss, linux-hams, netdev

On Thu, 27 Oct 2022 00:42:37 +0200 наб wrote:
> Since defanging in v2.6.12-rc1 it's set exactly once per port on probe
> and checked exactly once per port on unload: it's useless. Kill it.
> 
> Notably, magic-number.rst has never had the right value for it with the
> new-in-2.1.105 network-based driver
> 
> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>

Interesting name :S Just to be clear full legal names are required.
Not saying that's not your name, just saying I haven't heard it before.

Plus the From line must be the same, legal name.

> Ref: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/

Link: is the tag we use.

Otherwise looks fine.

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

* Re: [PATCH 12/15] drivers: net: slip: remove SLIP_MAGIC
  2022-10-26 22:43 ` [PATCH 12/15] drivers: net: slip: remove SLIP_MAGIC наб
@ 2022-10-27 13:11   ` Oliver Hartkopp
  2022-10-27 13:45     ` наб
  2022-10-28 13:57   ` Bagas Sanjaya
  1 sibling, 1 reply; 17+ messages in thread
From: Oliver Hartkopp @ 2022-10-27 13:11 UTC (permalink / raw)
  To: наб, Jiri Slaby
  Cc: Jonathan Corbet, Federico Vaga, Alex Shi, Yanteng Si, Hu Haowen,
	David S. Miller, Eric Dumazet, Jakub Kiciński, Paolo Abeni,
	Greg Kroah-Hartman, Marc Kleine-Budde, Sebastian Andrzej Siewior,
	Duoming Zhou, Huang Pei, linux-doc, linux-kernel,
	linux-doc-tw-discuss, netdev

Hi,

I'm not sure why I'm in 'To' here as I'm definitely not the official 
maintainer of slip.

But it looks like there is no real maintainer anyway but maybe Jiri ;-)

On 27.10.22 00:43, наб wrote:
> According to Greg, in the context of magic numbers as defined in
> magic-number.rst, "the tty layer should not need this and I'll gladly
> take patches"
> 
> We have largely moved away from this approach,
> and we have better debugging instrumentation nowadays: kill it
> 
> Additionally, all SLIP_MAGIC checks just early-exit instead
> of noting the bug, so they're detrimental, if anything
> 
> Ref: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/
> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>

Reviewed-by: Oliver Hartkopp <socketcan@hartkopp.net>


Many thanks!
Oliver

> ---
>   Documentation/process/magic-number.rst                |  1 -
>   .../translations/it_IT/process/magic-number.rst       |  1 -
>   .../translations/zh_CN/process/magic-number.rst       |  1 -
>   .../translations/zh_TW/process/magic-number.rst       |  1 -
>   drivers/net/slip/slip.c                               | 11 +++++------
>   drivers/net/slip/slip.h                               |  4 ----
>   6 files changed, 5 insertions(+), 14 deletions(-)
> 
> diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst
> index 3b3e607e1cbc..e59c707ec785 100644
> --- a/Documentation/process/magic-number.rst
> +++ b/Documentation/process/magic-number.rst
> @@ -69,6 +69,5 @@ Changelog::
>   Magic Name            Number           Structure                File
>   ===================== ================ ======================== ==========================================
>   FASYNC_MAGIC          0x4601           fasync_struct            ``include/linux/fs.h``
> -SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.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 e8c659b6a743..37a539867b6f 100644
> --- a/Documentation/translations/it_IT/process/magic-number.rst
> +++ b/Documentation/translations/it_IT/process/magic-number.rst
> @@ -75,6 +75,5 @@ Registro dei cambiamenti::
>   Nome magico           Numero           Struttura                File
>   ===================== ================ ======================== ==========================================
>   FASYNC_MAGIC          0x4601           fasync_struct            ``include/linux/fs.h``
> -SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.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 2105af32187c..8a3a3e872c52 100644
> --- a/Documentation/translations/zh_CN/process/magic-number.rst
> +++ b/Documentation/translations/zh_CN/process/magic-number.rst
> @@ -58,6 +58,5 @@ Linux 魔术数
>   魔术数名              数字             结构                     文件
>   ===================== ================ ======================== ==========================================
>   FASYNC_MAGIC          0x4601           fasync_struct            ``include/linux/fs.h``
> -SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.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 793a0ae9fb7c..7ace7834f7f9 100644
> --- a/Documentation/translations/zh_TW/process/magic-number.rst
> +++ b/Documentation/translations/zh_TW/process/magic-number.rst
> @@ -61,6 +61,5 @@ Linux 魔術數
>   魔術數名              數字             結構                     文件
>   ===================== ================ ======================== ==========================================
>   FASYNC_MAGIC          0x4601           fasync_struct            ``include/linux/fs.h``
> -SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
>   CCB_MAGIC             0xf2691ad2       ccb                      ``drivers/scsi/ncr53c8xx.c``
>   ===================== ================ ======================== ==========================================
> diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c
> index 6865d32270e5..95f5c79772e7 100644
> --- a/drivers/net/slip/slip.c
> +++ b/drivers/net/slip/slip.c
> @@ -426,7 +426,7 @@ static void slip_transmit(struct work_struct *work)
>   
>   	spin_lock_bh(&sl->lock);
>   	/* First make sure we're connected. */
> -	if (!sl->tty || sl->magic != SLIP_MAGIC || !netif_running(sl->dev)) {
> +	if (!sl->tty || !netif_running(sl->dev)) {
>   		spin_unlock_bh(&sl->lock);
>   		return;
>   	}
> @@ -690,7 +690,7 @@ static void slip_receive_buf(struct tty_struct *tty, const unsigned char *cp,
>   {
>   	struct slip *sl = tty->disc_data;
>   
> -	if (!sl || sl->magic != SLIP_MAGIC || !netif_running(sl->dev))
> +	if (!sl || !netif_running(sl->dev))
>   		return;
>   
>   	/* Read the characters out of the buffer */
> @@ -761,7 +761,6 @@ static struct slip *sl_alloc(void)
>   	sl = netdev_priv(dev);
>   
>   	/* Initialize channel control data */
> -	sl->magic       = SLIP_MAGIC;
>   	sl->dev	      	= dev;
>   	spin_lock_init(&sl->lock);
>   	INIT_WORK(&sl->tx_work, slip_transmit);
> @@ -809,7 +808,7 @@ static int slip_open(struct tty_struct *tty)
>   
>   	err = -EEXIST;
>   	/* First make sure we're not already connected. */
> -	if (sl && sl->magic == SLIP_MAGIC)
> +	if (sl)
>   		goto err_exit;
>   
>   	/* OK.  Find a free SLIP channel to use. */
> @@ -886,7 +885,7 @@ static void slip_close(struct tty_struct *tty)
>   	struct slip *sl = tty->disc_data;
>   
>   	/* First make sure we're connected. */
> -	if (!sl || sl->magic != SLIP_MAGIC || sl->tty != tty)
> +	if (!sl || sl->tty != tty)
>   		return;
>   
>   	spin_lock_bh(&sl->lock);
> @@ -1080,7 +1079,7 @@ static int slip_ioctl(struct tty_struct *tty, unsigned int cmd,
>   	int __user *p = (int __user *)arg;
>   
>   	/* First make sure we're connected. */
> -	if (!sl || sl->magic != SLIP_MAGIC)
> +	if (!sl)
>   		return -EINVAL;
>   
>   	switch (cmd) {
> diff --git a/drivers/net/slip/slip.h b/drivers/net/slip/slip.h
> index 3d7f88b330c1..d7dbedd27669 100644
> --- a/drivers/net/slip/slip.h
> +++ b/drivers/net/slip/slip.h
> @@ -50,8 +50,6 @@
>   
>   
>   struct slip {
> -  int			magic;
> -
>     /* Various fields. */
>     struct tty_struct	*tty;		/* ptr to TTY structure		*/
>     struct net_device	*dev;		/* easy for intr handling	*/
> @@ -100,6 +98,4 @@ struct slip {
>   #endif
>   };
>   
> -#define SLIP_MAGIC 0x5302
> -
>   #endif	/* _LINUX_SLIP.H */

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

* Re: [PATCH 12/15] drivers: net: slip: remove SLIP_MAGIC
  2022-10-27 13:11   ` Oliver Hartkopp
@ 2022-10-27 13:45     ` наб
  0 siblings, 0 replies; 17+ messages in thread
From: наб @ 2022-10-27 13:45 UTC (permalink / raw)
  To: Oliver Hartkopp
  Cc: Jiri Slaby, Jonathan Corbet, Federico Vaga, Alex Shi, Yanteng Si,
	Hu Haowen, David S. Miller, Eric Dumazet, Jakub Kiciński,
	Paolo Abeni, Greg Kroah-Hartman, Marc Kleine-Budde,
	Sebastian Andrzej Siewior, Duoming Zhou, Huang Pei, linux-doc,
	linux-kernel, linux-doc-tw-discuss, netdev

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

On Thu, Oct 27, 2022 at 03:11:56PM +0200, Oliver Hartkopp wrote:
> I'm not sure why I'm in 'To' here as I'm definitely not the official
> maintainer of slip.
> 
> But it looks like there is no real maintainer anyway but maybe Jiri ;-)

According to get_maintainer.pl,
(which I just shoved into Cc: indiscriminately,
 lacking any knowledge to the contrary),
you get picked up for slip.{c,h} as commit_signer:2/4=50% and 1/2, resp.

As does Jiri, so on that front we're good at least.

Best,

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

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

* Re: [PATCH 01/15] hamradio: baycom: remove BAYCOM_MAGIC
  2022-10-27  1:37 ` [PATCH 01/15] hamradio: baycom: remove BAYCOM_MAGIC Jakub Kicinski
@ 2022-10-28  1:54   ` Bagas Sanjaya
  0 siblings, 0 replies; 17+ messages in thread
From: Bagas Sanjaya @ 2022-10-28  1:54 UTC (permalink / raw)
  To: Jakub Kicinski, наб
  Cc: Jonathan Corbet, Federico Vaga, Alex Shi, Yanteng Si, Hu Haowen,
	Thomas Sailer, David S. Miller, Eric Dumazet, Paolo Abeni,
	Greg Kroah-Hartman, Jiri Slaby, linux-doc, linux-kernel,
	linux-doc-tw-discuss, linux-hams, netdev

On 10/27/22 08:37, Jakub Kicinski wrote:
> On Thu, 27 Oct 2022 00:42:37 +0200 наб wrote:
>> Since defanging in v2.6.12-rc1 it's set exactly once per port on probe
>> and checked exactly once per port on unload: it's useless. Kill it.
>>
>> Notably, magic-number.rst has never had the right value for it with the
>> new-in-2.1.105 network-based driver
>>
>> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
> 
> Interesting name :S Just to be clear full legal names are required.
> Not saying that's not your name, just saying I haven't heard it before.
> 
> Plus the From line must be the same, legal name.
> 

You mean From header (email).

In this case, she forgot to add From: tag before the patch description
(which could be easily added with --from option to git-format-patch(1)).

Thanks.

-- 
An old man doll... just what I always wanted! - Clara


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

* Re: [PATCH 01/15] hamradio: baycom: remove BAYCOM_MAGIC
  2022-10-26 22:42 [PATCH 01/15] hamradio: baycom: remove BAYCOM_MAGIC наб
                   ` (3 preceding siblings ...)
  2022-10-27  1:37 ` [PATCH 01/15] hamradio: baycom: remove BAYCOM_MAGIC Jakub Kicinski
@ 2022-10-28 13:13 ` Bagas Sanjaya
  2022-10-28 13:43   ` Dan Carpenter
  2022-10-28 21:43   ` наб
  4 siblings, 2 replies; 17+ messages in thread
From: Bagas Sanjaya @ 2022-10-28 13:13 UTC (permalink / raw)
  To: наб
  Cc: Jonathan Corbet, Federico Vaga, Alex Shi, Yanteng Si, Hu Haowen,
	Thomas Sailer, David S. Miller, Eric Dumazet, Jakub Kiciński,
	Paolo Abeni, Greg Kroah-Hartman, Jiri Slaby, linux-doc,
	linux-kernel, linux-doc-tw-discuss, linux-hams, netdev

On 10/27/22 05:42, наб wrote:
> Since defanging in v2.6.12-rc1 it's set exactly once per port on probe
> and checked exactly once per port on unload: it's useless. Kill it.
> 

What do you mean by defanging in that release?

Also, s/Kill it/Remove BAYCOM_MAGIC from magic numbers table/ (your
wording is kinda mature).

> Notably, magic-number.rst has never had the right value for it with the
> new-in-2.1.105 network-based driver
> 
> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
> Ref: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/

Use Link: tag instead.

Thanks.

-- 
An old man doll... just what I always wanted! - Clara


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

* Re: [PATCH 02/15] hamradio: yam: remove YAM_MAGIC
  2022-10-26 22:42 ` [PATCH 02/15] hamradio: yam: remove YAM_MAGIC наб
@ 2022-10-28 13:19   ` Bagas Sanjaya
  2022-10-28 13:44     ` Dan Carpenter
  0 siblings, 1 reply; 17+ messages in thread
From: Bagas Sanjaya @ 2022-10-28 13:19 UTC (permalink / raw)
  To: наб
  Cc: Jonathan Corbet, Federico Vaga, Alex Shi, Yanteng Si, Hu Haowen,
	Jean-Paul Roubelat, David S. Miller, Eric Dumazet,
	Jakub Kiciński, Paolo Abeni, Greg Kroah-Hartman, Jiri Slaby,
	linux-doc, linux-kernel, linux-doc-tw-discuss, linux-hams, netdev

On 10/27/22 05:42, наб wrote:
> This is cruft, and we have better debugging tooling nowadays: kill it
> 

That "mature phrase" again? Same reply as [1]. Thanks.

[1]: https://lore.kernel.org/linux-doc/47c2bffb-6bfe-7f5d-0d2d-3cbb99d31019@gmail.com/

-- 
An old man doll... just what I always wanted! - Clara


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

* Re: [PATCH 01/15] hamradio: baycom: remove BAYCOM_MAGIC
  2022-10-28 13:13 ` Bagas Sanjaya
@ 2022-10-28 13:43   ` Dan Carpenter
  2022-10-28 13:50     ` Bagas Sanjaya
  2022-10-28 21:43   ` наб
  1 sibling, 1 reply; 17+ messages in thread
From: Dan Carpenter @ 2022-10-28 13:43 UTC (permalink / raw)
  To: Bagas Sanjaya
  Cc: наб, Jonathan Corbet, Federico Vaga, Alex Shi,
	Yanteng Si, Hu Haowen, Thomas Sailer, David S. Miller,
	Eric Dumazet, Jakub Kiciński, Paolo Abeni,
	Greg Kroah-Hartman, Jiri Slaby, linux-doc, linux-kernel,
	linux-doc-tw-discuss, linux-hams, netdev

On Fri, Oct 28, 2022 at 08:13:49PM +0700, Bagas Sanjaya wrote:
> On 10/27/22 05:42, наб wrote:
> > Since defanging in v2.6.12-rc1 it's set exactly once per port on probe
> > and checked exactly once per port on unload: it's useless. Kill it.
> > 
> 
> What do you mean by defanging in that release?

I was also curious about this, but I accidentally sent my question
privately instead of to the list.

> 
> Also, s/Kill it/Remove BAYCOM_MAGIC from magic numbers table/ (your
> wording is kinda mature).
> 

The kernel has almost 13 thousand kills...

$ git grep -i kill | wc -l
12975
$

It's fine.

regards,
dan carpenter


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

* Re: [PATCH 02/15] hamradio: yam: remove YAM_MAGIC
  2022-10-28 13:19   ` Bagas Sanjaya
@ 2022-10-28 13:44     ` Dan Carpenter
  0 siblings, 0 replies; 17+ messages in thread
From: Dan Carpenter @ 2022-10-28 13:44 UTC (permalink / raw)
  To: Bagas Sanjaya
  Cc: наб, Jonathan Corbet, Federico Vaga, Alex Shi,
	Yanteng Si, Hu Haowen, Jean-Paul Roubelat, David S. Miller,
	Eric Dumazet, Jakub Kiciński, Paolo Abeni,
	Greg Kroah-Hartman, Jiri Slaby, linux-doc, linux-kernel,
	linux-doc-tw-discuss, linux-hams, netdev

On Fri, Oct 28, 2022 at 08:19:51PM +0700, Bagas Sanjaya wrote:
> On 10/27/22 05:42, наб wrote:
> > This is cruft, and we have better debugging tooling nowadays: kill it
> > 
> 
> That "mature phrase" again? Same reply as [1]. Thanks.
> 
> [1]: https://lore.kernel.org/linux-doc/47c2bffb-6bfe-7f5d-0d2d-3cbb99d31019@gmail.com/

This is just a link to your previous email which we just recieved...  :/

regards,
dan carpenter


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

* Re: [PATCH 01/15] hamradio: baycom: remove BAYCOM_MAGIC
  2022-10-28 13:43   ` Dan Carpenter
@ 2022-10-28 13:50     ` Bagas Sanjaya
  2022-10-28 14:07       ` Dan Carpenter
  0 siblings, 1 reply; 17+ messages in thread
From: Bagas Sanjaya @ 2022-10-28 13:50 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: наб, Jonathan Corbet, Federico Vaga, Alex Shi,
	Yanteng Si, Hu Haowen, Thomas Sailer, David S. Miller,
	Eric Dumazet, Jakub Kiciński, Paolo Abeni,
	Greg Kroah-Hartman, Jiri Slaby, linux-doc, linux-kernel,
	linux-doc-tw-discuss, linux-hams, netdev

On 10/28/22 20:43, Dan Carpenter wrote:
>>
>> Also, s/Kill it/Remove BAYCOM_MAGIC from magic numbers table/ (your
>> wording is kinda mature).
>>
> 
> The kernel has almost 13 thousand kills...
> 
> $ git grep -i kill | wc -l
> 12975
> $
> 
> It's fine.
> 

The word meaning depends on context. In this case, the author means
removing SOME_MAGIC magic number from the table, one by one until
the magic number documentation is removed (due to historical cruft).

Thanks.

-- 
An old man doll... just what I always wanted! - Clara


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

* Re: [PATCH 11/15] hdlcdrv: remove HDLCDRV_MAGIC
  2022-10-26 22:43 ` [PATCH 11/15] hdlcdrv: remove HDLCDRV_MAGIC наб
@ 2022-10-28 13:54   ` Bagas Sanjaya
  0 siblings, 0 replies; 17+ messages in thread
From: Bagas Sanjaya @ 2022-10-28 13:54 UTC (permalink / raw)
  To: наб
  Cc: Jonathan Corbet, Federico Vaga, Alex Shi, Yanteng Si, Hu Haowen,
	Thomas Sailer, David S. Miller, Eric Dumazet, Jakub Kiciński,
	Paolo Abeni, Greg Kroah-Hartman, Jiri Slaby, Jason A. Donenfeld,
	Kees Cook, Marc Kleine-Budde, Wolfram Sang, linux-doc,
	linux-kernel, linux-doc-tw-discuss, linux-hams, netdev

On 10/27/22 05:43, наб wrote:
> We have largely moved away from this approach,
> and we have better debugging instrumentation nowadays: kill it
> 

Same reply as [1].

> Additionally, ~half HDLCDRV_MAGIC checks just early-exit instead
> of noting the bug, so they're detrimental, if anything
> 

"... instead of handling the magic number"?

Thanks.

[1]: https://lore.kernel.org/linux-doc/80c998ec-435f-158c-9b45-4e6844f7861b@gmail.com/

-- 
An old man doll... just what I always wanted! - Clara


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

* Re: [PATCH 12/15] drivers: net: slip: remove SLIP_MAGIC
  2022-10-26 22:43 ` [PATCH 12/15] drivers: net: slip: remove SLIP_MAGIC наб
  2022-10-27 13:11   ` Oliver Hartkopp
@ 2022-10-28 13:57   ` Bagas Sanjaya
  1 sibling, 0 replies; 17+ messages in thread
From: Bagas Sanjaya @ 2022-10-28 13:57 UTC (permalink / raw)
  To: наб
  Cc: Jonathan Corbet, Federico Vaga, Alex Shi, Yanteng Si, Hu Haowen,
	David S. Miller, Eric Dumazet, Jakub Kiciński, Paolo Abeni,
	Greg Kroah-Hartman, Jiri Slaby, Marc Kleine-Budde,
	Oliver Hartkopp, Sebastian Andrzej Siewior, Duoming Zhou,
	Huang Pei, linux-doc, linux-kernel, linux-doc-tw-discuss, netdev

On 10/27/22 05:43, наб wrote:
> We have largely moved away from this approach,
> and we have better debugging instrumentation nowadays: kill it
> 
> Additionally, all SLIP_MAGIC checks just early-exit instead
> of noting the bug, so they're detrimental, if anything
> 

Same reply as [1].

[1]: https://lore.kernel.org/linux-doc/9386b19f-dd99-3601-9e87-3056100dfe53@gmail.com/

-- 
An old man doll... just what I always wanted! - Clara


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

* Re: [PATCH 01/15] hamradio: baycom: remove BAYCOM_MAGIC
  2022-10-28 13:50     ` Bagas Sanjaya
@ 2022-10-28 14:07       ` Dan Carpenter
  0 siblings, 0 replies; 17+ messages in thread
From: Dan Carpenter @ 2022-10-28 14:07 UTC (permalink / raw)
  To: Bagas Sanjaya
  Cc: наб, Jonathan Corbet, Federico Vaga, Alex Shi,
	Yanteng Si, Hu Haowen, Thomas Sailer, David S. Miller,
	Eric Dumazet, Jakub Kiciński, Paolo Abeni,
	Greg Kroah-Hartman, Jiri Slaby, linux-doc, linux-kernel,
	linux-doc-tw-discuss, linux-hams, netdev

On Fri, Oct 28, 2022 at 08:50:59PM +0700, Bagas Sanjaya wrote:
> On 10/28/22 20:43, Dan Carpenter wrote:
> >>
> >> Also, s/Kill it/Remove BAYCOM_MAGIC from magic numbers table/ (your
> >> wording is kinda mature).
> >>
> > 
> > The kernel has almost 13 thousand kills...
> > 
> > $ git grep -i kill | wc -l
> > 12975
> > $
> > 
> > It's fine.
> > 
> 
> The word meaning depends on context. In this case, the author means
> removing SOME_MAGIC magic number from the table, one by one until
> the magic number documentation is removed (due to historical cruft).

Kernel devs are naturally blood thirsty people...

$ git log --after=2022-01-01 | grep -w kill | wc -l
207

When people talk about killing stuff they mostly mean deleting code.
Look at this sample of the very first kills from January.  Seven out
of ten times this is what they meant.

$ git log --after=2022-01-01 | grep -w kill | head -n 10
    useless now, kill it.
    net: ipa: kill ipa_table_valid()
    net: ipa: kill two constant symbols
      io_uring: kill hot path fixed file bitmap debug checks
                   newattrs.ia_valid = ATTR_FORCE | kill;
                newattrs.ia_valid = ATTR_FORCE | kill;
                        newattrs.ia_valid = attr_force | kill;
    kill it off before it ends up in a release. It was just part of the
    io_uring: kill hot path fixed file bitmap debug checks
      block: kill deprecated BUG_ON() in the flush handling
$

regards,
dan carpenter

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

* Re: [PATCH 01/15] hamradio: baycom: remove BAYCOM_MAGIC
  2022-10-28 13:13 ` Bagas Sanjaya
  2022-10-28 13:43   ` Dan Carpenter
@ 2022-10-28 21:43   ` наб
  1 sibling, 0 replies; 17+ messages in thread
From: наб @ 2022-10-28 21:43 UTC (permalink / raw)
  To: Bagas Sanjaya
  Cc: Jonathan Corbet, Federico Vaga, Alex Shi, Yanteng Si, Hu Haowen,
	Thomas Sailer, David S. Miller, Eric Dumazet, Jakub Kiciński,
	Paolo Abeni, Greg Kroah-Hartman, Jiri Slaby, linux-doc,
	linux-kernel, linux-doc-tw-discuss, linux-hams, netdev

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

On Fri, Oct 28, 2022 at 08:13:49PM +0700, Bagas Sanjaya wrote:
> On 10/27/22 05:42, наб wrote:
> > Since defanging in v2.6.12-rc1 it's set exactly once per port on probe
> > and checked exactly once per port on unload: it's useless. Kill it.
> > 
> 
> What do you mean by defanging in that release?

Before v2.6.12-rc1, there were baycom_paranoia_check{,_void}() macros
(which logged at KERN_ERR and returned an error),
used before each netdev_priv(); after, this is reduced to the single
check in the cleanup we observe presently.

I've rephrased the message to make it more palatable.

Best,

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

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

end of thread, other threads:[~2022-10-28 21:43 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-26 22:42 [PATCH 01/15] hamradio: baycom: remove BAYCOM_MAGIC наб
2022-10-26 22:42 ` [PATCH 02/15] hamradio: yam: remove YAM_MAGIC наб
2022-10-28 13:19   ` Bagas Sanjaya
2022-10-28 13:44     ` Dan Carpenter
2022-10-26 22:43 ` [PATCH 11/15] hdlcdrv: remove HDLCDRV_MAGIC наб
2022-10-28 13:54   ` Bagas Sanjaya
2022-10-26 22:43 ` [PATCH 12/15] drivers: net: slip: remove SLIP_MAGIC наб
2022-10-27 13:11   ` Oliver Hartkopp
2022-10-27 13:45     ` наб
2022-10-28 13:57   ` Bagas Sanjaya
2022-10-27  1:37 ` [PATCH 01/15] hamradio: baycom: remove BAYCOM_MAGIC Jakub Kicinski
2022-10-28  1:54   ` Bagas Sanjaya
2022-10-28 13:13 ` Bagas Sanjaya
2022-10-28 13:43   ` Dan Carpenter
2022-10-28 13:50     ` Bagas Sanjaya
2022-10-28 14:07       ` Dan Carpenter
2022-10-28 21:43   ` наб

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).