Skip to contentSkip to conversation

Remove every trace of SERIAL_MAGIC

PATCH In review Pascal Terjan 5 participants 10 messages Sep 27, 2019 – Nov 5, 2019 1 message not in the archive

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove every trace of SERIAL_MAGIC

The only code mentioning it doesn't build (and hasn't at least since git) and doesn't include the header defining it.

This means removing support for checking magic in amiserial.c (SERIAL_PARANOIA_CHECK option), which was checking a magic field which doesn't currently exist in the struct.

---
 Documentation/process/magic-number.rst        |  1 -
 .../it_IT/process/magic-number.rst            |  1 -
 .../zh_CN/process/magic-number.rst            |  1 -
 drivers/net/wan/z85230.h                      |  2 -
 drivers/tty/amiserial.c                       | 81 +------------------
 5 files changed, 1 insertion(+), 85 deletions(-)
Documentation/process/magic-number.rst +0 -1
index 547bbf28e615..eee9b44553b3 100644
@@ -81,7 +81,6 @@ FF_MAGIC              0x4646           fc_info                  ``drivers/net/ip
 ISICOM_MAGIC          0x4d54           isi_port                 ``include/linux/isicom.h``
 PTY_MAGIC             0x5001                                    ``drivers/char/pty.c``
 PPP_MAGIC             0x5002           ppp                      ``include/linux/if_pppvar.h``
-SERIAL_MAGIC          0x5301           async_struct             ``include/linux/serial.h``
 SSTATE_MAGIC          0x5302           serial_state             ``include/linux/serial.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
 STRIP_MAGIC           0x5303           strip                    ``drivers/net/strip.c``
Documentation/translations/it_IT/process/magic-number.rst +0 -1
index ed1121d0ba84..783e0de314a0 100644
@@ -87,7 +87,6 @@ FF_MAGIC              0x4646           fc_info                  ``drivers/net/ip
 ISICOM_MAGIC          0x4d54           isi_port                 ``include/linux/isicom.h``
 PTY_MAGIC             0x5001                                    ``drivers/char/pty.c``
 PPP_MAGIC             0x5002           ppp                      ``include/linux/if_pppvar.h``
-SERIAL_MAGIC          0x5301           async_struct             ``include/linux/serial.h``
 SSTATE_MAGIC          0x5302           serial_state             ``include/linux/serial.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
 STRIP_MAGIC           0x5303           strip                    ``drivers/net/strip.c``
Documentation/translations/zh_CN/process/magic-number.rst +0 -1
index 15c592518194..e4c225996af0 100644
@@ -70,7 +70,6 @@ FF_MAGIC              0x4646           fc_info                  ``drivers/net/ip
 ISICOM_MAGIC          0x4d54           isi_port                 ``include/linux/isicom.h``
 PTY_MAGIC             0x5001                                    ``drivers/char/pty.c``
 PPP_MAGIC             0x5002           ppp                      ``include/linux/if_pppvar.h``
-SERIAL_MAGIC          0x5301           async_struct             ``include/linux/serial.h``
 SSTATE_MAGIC          0x5302           serial_state             ``include/linux/serial.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
 STRIP_MAGIC           0x5303           strip                    ``drivers/net/strip.c``
drivers/net/wan/z85230.h +0 -2
index 32ae710d4f40..1081d171e477 100644
@@ -421,8 +421,6 @@ extern struct z8530_irqhandler z8530_sync, z8530_async, z8530_nop;
  *	Asynchronous Interfacing
  */
 
-#define SERIAL_MAGIC 0x5301
-
 /*
  * The size of the serial xmit buffer is 1 page, or 4096 bytes
  */
drivers/tty/amiserial.c +1 -80

214 lines not on this page · raw message

Signature · 1 line
2.23.0.444.g18eeb5a265-goog
#1 lore raw
Quoted 6 lines · Pascal Terjan

The only code mentioning it doesn't build (and hasn't at least since git) and doesn't include the header defining it.

This means removing support for checking magic in amiserial.c (SERIAL_PARANOIA_CHECK option), which was checking a magic field which doesn't currently exist in the struct.

Quoted 7 lines
---
 Documentation/process/magic-number.rst        |  1 -
 .../it_IT/process/magic-number.rst            |  1 -
 .../zh_CN/process/magic-number.rst            |  1 -
 drivers/net/wan/z85230.h                      |  2 -
 drivers/tty/amiserial.c                       | 81 +------------------
 5 files changed, 1 insertion(+), 85 deletions(-)

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.

You are receiving this message because of the following common error(s) as indicated below:

- Your patch does not have a Signed-off-by: line. Please read the kernel file, Documentation/SubmittingPatches and resend it after adding that line. Note, the line needs to be in the body of the email, before the patch, not at the bottom of the patch or in the email signature.

If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.

thanks,

greg k-h's patch email bot

#2 lore raw

PATCH 1/1 Remove every trace of SERIAL_MAGIC

The only code mentioning it doesn't build (and hasn't at least since git) and doesn't include the header defining it.

This means removing support for checking magic in amiserial.c (SERIAL_PARANOIA_CHECK option), which was checking a magic field which doesn't currently exist in the struct.

---
 Documentation/process/magic-number.rst        |  1 -
 .../it_IT/process/magic-number.rst            |  1 -
 .../zh_CN/process/magic-number.rst            |  1 -
 drivers/net/wan/z85230.h                      |  2 -
 drivers/tty/amiserial.c                       | 81 +------------------
 5 files changed, 1 insertion(+), 85 deletions(-)
Documentation/process/magic-number.rst +0 -1
index 547bbf28e615..eee9b44553b3 100644
@@ -81,7 +81,6 @@ FF_MAGIC              0x4646           fc_info                  ``drivers/net/ip
 ISICOM_MAGIC          0x4d54           isi_port                 ``include/linux/isicom.h``
 PTY_MAGIC             0x5001                                    ``drivers/char/pty.c``
 PPP_MAGIC             0x5002           ppp                      ``include/linux/if_pppvar.h``
-SERIAL_MAGIC          0x5301           async_struct             ``include/linux/serial.h``
 SSTATE_MAGIC          0x5302           serial_state             ``include/linux/serial.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
 STRIP_MAGIC           0x5303           strip                    ``drivers/net/strip.c``
Documentation/translations/it_IT/process/magic-number.rst +0 -1
index ed1121d0ba84..783e0de314a0 100644
@@ -87,7 +87,6 @@ FF_MAGIC              0x4646           fc_info                  ``drivers/net/ip
 ISICOM_MAGIC          0x4d54           isi_port                 ``include/linux/isicom.h``
 PTY_MAGIC             0x5001                                    ``drivers/char/pty.c``
 PPP_MAGIC             0x5002           ppp                      ``include/linux/if_pppvar.h``
-SERIAL_MAGIC          0x5301           async_struct             ``include/linux/serial.h``
 SSTATE_MAGIC          0x5302           serial_state             ``include/linux/serial.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
 STRIP_MAGIC           0x5303           strip                    ``drivers/net/strip.c``
Documentation/translations/zh_CN/process/magic-number.rst +0 -1
index 15c592518194..e4c225996af0 100644
@@ -70,7 +70,6 @@ FF_MAGIC              0x4646           fc_info                  ``drivers/net/ip
 ISICOM_MAGIC          0x4d54           isi_port                 ``include/linux/isicom.h``
 PTY_MAGIC             0x5001                                    ``drivers/char/pty.c``
 PPP_MAGIC             0x5002           ppp                      ``include/linux/if_pppvar.h``
-SERIAL_MAGIC          0x5301           async_struct             ``include/linux/serial.h``
 SSTATE_MAGIC          0x5302           serial_state             ``include/linux/serial.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
 STRIP_MAGIC           0x5303           strip                    ``drivers/net/strip.c``
drivers/net/wan/z85230.h +0 -2
index 32ae710d4f40..1081d171e477 100644
@@ -421,8 +421,6 @@ extern struct z8530_irqhandler z8530_sync, z8530_async, z8530_nop;
  *	Asynchronous Interfacing
  */
 
-#define SERIAL_MAGIC 0x5301
-
 /*
  * The size of the serial xmit buffer is 1 page, or 4096 bytes
  */
drivers/tty/amiserial.c +1 -80

214 lines not on this page · raw message

Signature · 1 line
2.23.0.581.g78d2f28ef7-goog
#3 lore raw
Quoted 7 lines · Pascal Terjan

The only code mentioning it doesn't build (and hasn't at least since git) and doesn't include the header defining it.

This means removing support for checking magic in amiserial.c (SERIAL_PARANOIA_CHECK option), which was checking a magic field which doesn't currently exist in the struct.

Quoted 8 lines
---
 Documentation/process/magic-number.rst        |  1 -
 .../it_IT/process/magic-number.rst            |  1 -
 .../zh_CN/process/magic-number.rst            |  1 -
 drivers/net/wan/z85230.h                      |  2 -
 drivers/tty/amiserial.c                       | 81 +------------------
 5 files changed, 1 insertion(+), 85 deletions(-)

What changed from the first version?

Always version your patches and properly put what changed below the --- line. Like the documentation says to do :)

v3 please?

thanks,

greg k-h

#4 lore raw

PATCH v3 1/1 Remove every trace of SERIAL_MAGIC

This means removing support for some debugging code in amiserial.c (SERIAL_PARANOIA_CHECK option), which was checking a magic field which doesn't currently exist in the struct. That code hasn't built at least since git.

Removing the definition from the header is safe anyway as that code was from another driver and not including it.

---
No code change in v3, only a less confusing description.

 Documentation/process/magic-number.rst        |  1 -
 .../it_IT/process/magic-number.rst            |  1 -
 .../zh_CN/process/magic-number.rst            |  1 -
 drivers/net/wan/z85230.h                      |  2 -
 drivers/tty/amiserial.c                       | 81 +------------------
 5 files changed, 1 insertion(+), 85 deletions(-)
Documentation/process/magic-number.rst +0 -1
index 547bbf28e615..eee9b44553b3 100644
@@ -81,7 +81,6 @@ FF_MAGIC              0x4646           fc_info                  ``drivers/net/ip
 ISICOM_MAGIC          0x4d54           isi_port                 ``include/linux/isicom.h``
 PTY_MAGIC             0x5001                                    ``drivers/char/pty.c``
 PPP_MAGIC             0x5002           ppp                      ``include/linux/if_pppvar.h``
-SERIAL_MAGIC          0x5301           async_struct             ``include/linux/serial.h``
 SSTATE_MAGIC          0x5302           serial_state             ``include/linux/serial.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
 STRIP_MAGIC           0x5303           strip                    ``drivers/net/strip.c``
Documentation/translations/it_IT/process/magic-number.rst +0 -1
index ed1121d0ba84..783e0de314a0 100644
@@ -87,7 +87,6 @@ FF_MAGIC              0x4646           fc_info                  ``drivers/net/ip
 ISICOM_MAGIC          0x4d54           isi_port                 ``include/linux/isicom.h``
 PTY_MAGIC             0x5001                                    ``drivers/char/pty.c``
 PPP_MAGIC             0x5002           ppp                      ``include/linux/if_pppvar.h``
-SERIAL_MAGIC          0x5301           async_struct             ``include/linux/serial.h``
 SSTATE_MAGIC          0x5302           serial_state             ``include/linux/serial.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
 STRIP_MAGIC           0x5303           strip                    ``drivers/net/strip.c``
Documentation/translations/zh_CN/process/magic-number.rst +0 -1
index 15c592518194..e4c225996af0 100644
@@ -70,7 +70,6 @@ FF_MAGIC              0x4646           fc_info                  ``drivers/net/ip
 ISICOM_MAGIC          0x4d54           isi_port                 ``include/linux/isicom.h``
 PTY_MAGIC             0x5001                                    ``drivers/char/pty.c``
 PPP_MAGIC             0x5002           ppp                      ``include/linux/if_pppvar.h``
-SERIAL_MAGIC          0x5301           async_struct             ``include/linux/serial.h``
 SSTATE_MAGIC          0x5302           serial_state             ``include/linux/serial.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
 STRIP_MAGIC           0x5303           strip                    ``drivers/net/strip.c``
drivers/net/wan/z85230.h +0 -2
index 32ae710d4f40..1081d171e477 100644
@@ -421,8 +421,6 @@ extern struct z8530_irqhandler z8530_sync, z8530_async, z8530_nop;
  *	Asynchronous Interfacing
  */
 
-#define SERIAL_MAGIC 0x5301
-
 /*
  * The size of the serial xmit buffer is 1 page, or 4096 bytes
  */
drivers/tty/amiserial.c +1 -80

214 lines not on this page · raw message

Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
Reviewed-by on v3 1/1
#5 lore raw

Hi Pascal,

Quoted 9 lines · Pascal Terjan

This means removing support for some debugging code in amiserial.c (SERIAL_PARANOIA_CHECK option), which was checking a magic field which doesn't currently exist in the struct. That code hasn't built at least since git.

Removing the definition from the header is safe anyway as that code was from another driver and not including it.

Thanks for your patch!

drivers/tty/amiserial.c line 28

Quoted 13 lines
drivers/tty/amiserial.c +1 -4
@@ -23,17 +23,12 @@
  */
 
 /*
- * Serial driver configuration section.  Here are the various options:
+ * Serial driver configuration section.
  *
- * SERIAL_PARANOIA_CHECK
- *             Check the magic number for the async_structure where
- *             ever possible.
  */

You might as well drop the whole comment block, as no options are left.

With that fixed:

BTW, there's a similar serial_paranoia_check() in drivers/tty/cyclades.c, which is active, but doesn't serve much purpose, IMHO.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#6 lore raw

PATCH v4 1/1 Remove every trace of SERIAL_MAGIC

This means removing support for checking magic in amiserial.c (SERIAL_PARANOIA_CHECK option), which was checking a magic field which doesn't currently exist in the struct. That code hasn't built at least since git.

Removing the definition from the header is safe anyway as that code was from another driver and not including it.

---
v4 removes the now empty comment block listing configuration options as suggested.

 Documentation/process/magic-number.rst        |  1 -
 .../it_IT/process/magic-number.rst            |  1 -
 .../zh_CN/process/magic-number.rst            |  1 -
 drivers/net/wan/z85230.h                      |  2 -
 drivers/tty/amiserial.c                       | 84 -------------------
 5 files changed, 89 deletions(-)
Documentation/process/magic-number.rst +0 -1
index 547bbf28e615..eee9b44553b3 100644
@@ -81,7 +81,6 @@ FF_MAGIC              0x4646           fc_info                  ``drivers/net/ip
 ISICOM_MAGIC          0x4d54           isi_port                 ``include/linux/isicom.h``
 PTY_MAGIC             0x5001                                    ``drivers/char/pty.c``
 PPP_MAGIC             0x5002           ppp                      ``include/linux/if_pppvar.h``
-SERIAL_MAGIC          0x5301           async_struct             ``include/linux/serial.h``
 SSTATE_MAGIC          0x5302           serial_state             ``include/linux/serial.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
 STRIP_MAGIC           0x5303           strip                    ``drivers/net/strip.c``
Documentation/translations/it_IT/process/magic-number.rst +0 -1
index ed1121d0ba84..783e0de314a0 100644
@@ -87,7 +87,6 @@ FF_MAGIC              0x4646           fc_info                  ``drivers/net/ip
 ISICOM_MAGIC          0x4d54           isi_port                 ``include/linux/isicom.h``
 PTY_MAGIC             0x5001                                    ``drivers/char/pty.c``
 PPP_MAGIC             0x5002           ppp                      ``include/linux/if_pppvar.h``
-SERIAL_MAGIC          0x5301           async_struct             ``include/linux/serial.h``
 SSTATE_MAGIC          0x5302           serial_state             ``include/linux/serial.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
 STRIP_MAGIC           0x5303           strip                    ``drivers/net/strip.c``
Documentation/translations/zh_CN/process/magic-number.rst +0 -1
index 15c592518194..e4c225996af0 100644
@@ -70,7 +70,6 @@ FF_MAGIC              0x4646           fc_info                  ``drivers/net/ip
 ISICOM_MAGIC          0x4d54           isi_port                 ``include/linux/isicom.h``
 PTY_MAGIC             0x5001                                    ``drivers/char/pty.c``
 PPP_MAGIC             0x5002           ppp                      ``include/linux/if_pppvar.h``
-SERIAL_MAGIC          0x5301           async_struct             ``include/linux/serial.h``
 SSTATE_MAGIC          0x5302           serial_state             ``include/linux/serial.h``
 SLIP_MAGIC            0x5302           slip                     ``drivers/net/slip.h``
 STRIP_MAGIC           0x5303           strip                    ``drivers/net/strip.c``
drivers/net/wan/z85230.h +0 -2
index 32ae710d4f40..1081d171e477 100644
@@ -421,8 +421,6 @@ extern struct z8530_irqhandler z8530_sync, z8530_async, z8530_nop;
  *	Asynchronous Interfacing
  */
 
-#define SERIAL_MAGIC 0x5301
-
 /*
  * The size of the serial xmit buffer is 1 page, or 4096 bytes
  */
drivers/tty/amiserial.c +0 -84

214 lines not on this page · raw message

Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#7 lore raw
In reply to Pascal Terjan
Quoted 2 lines · Pascal Terjan

The only code mentioning it doesn't build (and hasn't at least since git) and doesn't include the header defining it.

What do you mean, amiserial doesn't build?

root@elgar:~> grep AMIGA_BUILTIN_SERIAL /boot/config-$(uname -r) CONFIG_AMIGA_BUILTIN_SERIAL=y
root@elgar:~>

root@elgar:~> uname -a
Linux elgar 5.2.0-2-m68k #1 Debian 5.2.9-2 (2019-08-21) m68k GNU/Linux root@elgar:~>

We're using this driver, it works just fine.

And I'm not sure what SERIAL_MAGIC does. Is that for CONFIG_MAGIC_SYSRQ_SERIAL? Because we still use that, too. Although I haven't tested it for a while but I'm using the serial console on my Amiga 4000 right now using amiserial.c.

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

A message that is not in the archive (sent off-list or not yet received): CAANdO=LB1=i6qKt+J6yBXg9EaPJ66yZ_bkd96hftKkcR0Ee06w@mail.gmail.com

#9 lore raw
Quoted 7 lines · Pascal Terjan

On 10/4/19 3:20 PM, Pascal Terjan wrote:
> The only code mentioning it doesn't build (and hasn't at least since git) > and doesn't include the header defining it.
What do you mean, amiserial doesn't build?

The code doesn't build if enabling the "option" SERIAL_PARANOIA_CHECK in the file, this patch is removing that option and he code protected by it

Okay, so apparently what this does is checking whether any "struct serial_state *info" passed to the driver contains the correct SERIAL_MAGIC in info->magic and if not, prints a warning to the kernel buffer.

I have no idea what this being used for. Maybe Geert can comment on this.

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
#10 lore raw
In reply to John Paul Adrian Glaubitz

[ Sorry, for previous HTML email, trying to send patches from work machine for the first time, re-sending in text ]

Quoted 5 lines · John Paul Adrian Glaubitz
Quoted 2 lines · Pascal Terjan

The only code mentioning it doesn't build (and hasn't at least since git) and doesn't include the header defining it.

What do you mean, amiserial doesn't build?

The code doesn't build if enabling the "option" SERIAL_PARANOIA_CHECK in the file, this patch is removing that option and he code protected by it

Quoted 11 lines

root@elgar:~> grep AMIGA_BUILTIN_SERIAL /boot/config-$(uname -r) CONFIG_AMIGA_BUILTIN_SERIAL=y
root@elgar:~>

root@elgar:~> uname -a
Linux elgar 5.2.0-2-m68k #1 Debian 5.2.9-2 (2019-08-21) m68k GNU/Linux root@elgar:~>

We're using this driver, it works just fine.

And I'm not sure what SERIAL_MAGIC does. Is that for CONFIG_MAGIC_SYSRQ_SERIAL?

It used to be a magic number in the struct to verify you are getting the expected object

Quoted 3 lines

Because we still use that, too. Although I haven't tested it for a while but I'm using the serial console on my Amiga 4000 right now using amiserial.c.