Commit 981b22b8 authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

tty: remove TTY_LDISC_MAGIC

First, it is never checked. Second, use of it as a debugging aid is
at least questionable. With the current tools, I don't think anyone used
this kind of thing for debugging purposes for years.

On the top of that, e.g. serdev does not set this field of tty_ldisc_ops
at all.

So get rid of this legacy.
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210302062214.29627-8-jslaby@suse.czSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3b00b6af
...@@ -88,7 +88,6 @@ TTY_MAGIC 0x5401 tty_struct ``include/linux/ ...@@ -88,7 +88,6 @@ TTY_MAGIC 0x5401 tty_struct ``include/linux/
MGSL_MAGIC 0x5401 mgsl_info ``drivers/char/synclink.c`` MGSL_MAGIC 0x5401 mgsl_info ``drivers/char/synclink.c``
TTY_DRIVER_MAGIC 0x5402 tty_driver ``include/linux/tty_driver.h`` TTY_DRIVER_MAGIC 0x5402 tty_driver ``include/linux/tty_driver.h``
MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/pcmcia/synclink_cs.c`` MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/pcmcia/synclink_cs.c``
TTY_LDISC_MAGIC 0x5403 tty_ldisc ``include/linux/tty_ldisc.h``
USB_SERIAL_MAGIC 0x6702 usb_serial ``drivers/usb/serial/usb-serial.h`` USB_SERIAL_MAGIC 0x6702 usb_serial ``drivers/usb/serial/usb-serial.h``
FULL_DUPLEX_MAGIC 0x6969 ``drivers/net/ethernet/dec/tulip/de2104x.c`` FULL_DUPLEX_MAGIC 0x6969 ``drivers/net/ethernet/dec/tulip/de2104x.c``
USB_BLUETOOTH_MAGIC 0x6d02 usb_bluetooth ``drivers/usb/class/bluetty.c`` USB_BLUETOOTH_MAGIC 0x6d02 usb_bluetooth ``drivers/usb/class/bluetty.c``
......
...@@ -94,7 +94,6 @@ TTY_MAGIC 0x5401 tty_struct ``include/linux/ ...@@ -94,7 +94,6 @@ TTY_MAGIC 0x5401 tty_struct ``include/linux/
MGSL_MAGIC 0x5401 mgsl_info ``drivers/char/synclink.c`` MGSL_MAGIC 0x5401 mgsl_info ``drivers/char/synclink.c``
TTY_DRIVER_MAGIC 0x5402 tty_driver ``include/linux/tty_driver.h`` TTY_DRIVER_MAGIC 0x5402 tty_driver ``include/linux/tty_driver.h``
MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/pcmcia/synclink_cs.c`` MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/pcmcia/synclink_cs.c``
TTY_LDISC_MAGIC 0x5403 tty_ldisc ``include/linux/tty_ldisc.h``
USB_SERIAL_MAGIC 0x6702 usb_serial ``drivers/usb/serial/usb-serial.h`` USB_SERIAL_MAGIC 0x6702 usb_serial ``drivers/usb/serial/usb-serial.h``
FULL_DUPLEX_MAGIC 0x6969 ``drivers/net/ethernet/dec/tulip/de2104x.c`` FULL_DUPLEX_MAGIC 0x6969 ``drivers/net/ethernet/dec/tulip/de2104x.c``
USB_BLUETOOTH_MAGIC 0x6d02 usb_bluetooth ``drivers/usb/class/bluetty.c`` USB_BLUETOOTH_MAGIC 0x6d02 usb_bluetooth ``drivers/usb/class/bluetty.c``
......
...@@ -77,7 +77,6 @@ TTY_MAGIC 0x5401 tty_struct ``include/linux/ ...@@ -77,7 +77,6 @@ TTY_MAGIC 0x5401 tty_struct ``include/linux/
MGSL_MAGIC 0x5401 mgsl_info ``drivers/char/synclink.c`` MGSL_MAGIC 0x5401 mgsl_info ``drivers/char/synclink.c``
TTY_DRIVER_MAGIC 0x5402 tty_driver ``include/linux/tty_driver.h`` TTY_DRIVER_MAGIC 0x5402 tty_driver ``include/linux/tty_driver.h``
MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/pcmcia/synclink_cs.c`` MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/pcmcia/synclink_cs.c``
TTY_LDISC_MAGIC 0x5403 tty_ldisc ``include/linux/tty_ldisc.h``
USB_SERIAL_MAGIC 0x6702 usb_serial ``drivers/usb/serial/usb-serial.h`` USB_SERIAL_MAGIC 0x6702 usb_serial ``drivers/usb/serial/usb-serial.h``
FULL_DUPLEX_MAGIC 0x6969 ``drivers/net/ethernet/dec/tulip/de2104x.c`` FULL_DUPLEX_MAGIC 0x6969 ``drivers/net/ethernet/dec/tulip/de2104x.c``
USB_BLUETOOTH_MAGIC 0x6d02 usb_bluetooth ``drivers/usb/class/bluetty.c`` USB_BLUETOOTH_MAGIC 0x6d02 usb_bluetooth ``drivers/usb/class/bluetty.c``
......
...@@ -104,7 +104,6 @@ static int spk_ttyio_receive_buf2(struct tty_struct *tty, ...@@ -104,7 +104,6 @@ static int spk_ttyio_receive_buf2(struct tty_struct *tty,
static struct tty_ldisc_ops spk_ttyio_ldisc_ops = { static struct tty_ldisc_ops spk_ttyio_ldisc_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.magic = TTY_LDISC_MAGIC,
.name = "speakup_ldisc", .name = "speakup_ldisc",
.open = spk_ttyio_ldisc_open, .open = spk_ttyio_ldisc_open,
.close = spk_ttyio_ldisc_close, .close = spk_ttyio_ldisc_close,
......
...@@ -821,7 +821,6 @@ static __poll_t hci_uart_tty_poll(struct tty_struct *tty, ...@@ -821,7 +821,6 @@ static __poll_t hci_uart_tty_poll(struct tty_struct *tty,
static struct tty_ldisc_ops hci_uart_ldisc = { static struct tty_ldisc_ops hci_uart_ldisc = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.magic = TTY_LDISC_MAGIC,
.name = "n_hci", .name = "n_hci",
.open = hci_uart_tty_open, .open = hci_uart_tty_open,
.close = hci_uart_tty_close, .close = hci_uart_tty_close,
......
...@@ -845,7 +845,6 @@ static void st_tty_flush_buffer(struct tty_struct *tty) ...@@ -845,7 +845,6 @@ static void st_tty_flush_buffer(struct tty_struct *tty)
} }
static struct tty_ldisc_ops st_ldisc_ops = { static struct tty_ldisc_ops st_ldisc_ops = {
.magic = TTY_LDISC_MAGIC,
.name = "n_st", .name = "n_st",
.open = st_tty_open, .open = st_tty_open,
.close = st_tty_close, .close = st_tty_close,
......
...@@ -382,7 +382,6 @@ static void ldisc_close(struct tty_struct *tty) ...@@ -382,7 +382,6 @@ static void ldisc_close(struct tty_struct *tty)
/* The line discipline structure. */ /* The line discipline structure. */
static struct tty_ldisc_ops caif_ldisc = { static struct tty_ldisc_ops caif_ldisc = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.magic = TTY_LDISC_MAGIC,
.name = "n_caif", .name = "n_caif",
.open = ldisc_open, .open = ldisc_open,
.close = ldisc_close, .close = ldisc_close,
......
...@@ -697,7 +697,6 @@ static int slcan_ioctl(struct tty_struct *tty, struct file *file, ...@@ -697,7 +697,6 @@ static int slcan_ioctl(struct tty_struct *tty, struct file *file,
static struct tty_ldisc_ops slc_ldisc = { static struct tty_ldisc_ops slc_ldisc = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.magic = TTY_LDISC_MAGIC,
.name = "slcan", .name = "slcan",
.open = slcan_open, .open = slcan_open,
.close = slcan_close, .close = slcan_close,
......
...@@ -749,7 +749,6 @@ static int sixpack_ioctl(struct tty_struct *tty, struct file *file, ...@@ -749,7 +749,6 @@ static int sixpack_ioctl(struct tty_struct *tty, struct file *file,
static struct tty_ldisc_ops sp_ldisc = { static struct tty_ldisc_ops sp_ldisc = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.magic = TTY_LDISC_MAGIC,
.name = "6pack", .name = "6pack",
.open = sixpack_open, .open = sixpack_open,
.close = sixpack_close, .close = sixpack_close,
......
...@@ -933,7 +933,6 @@ static void mkiss_write_wakeup(struct tty_struct *tty) ...@@ -933,7 +933,6 @@ static void mkiss_write_wakeup(struct tty_struct *tty)
static struct tty_ldisc_ops ax_ldisc = { static struct tty_ldisc_ops ax_ldisc = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.magic = TTY_LDISC_MAGIC,
.name = "mkiss", .name = "mkiss",
.open = mkiss_open, .open = mkiss_open,
.close = mkiss_close, .close = mkiss_close,
......
...@@ -372,7 +372,6 @@ ppp_asynctty_wakeup(struct tty_struct *tty) ...@@ -372,7 +372,6 @@ ppp_asynctty_wakeup(struct tty_struct *tty)
static struct tty_ldisc_ops ppp_ldisc = { static struct tty_ldisc_ops ppp_ldisc = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.magic = TTY_LDISC_MAGIC,
.name = "ppp", .name = "ppp",
.open = ppp_asynctty_open, .open = ppp_asynctty_open,
.close = ppp_asynctty_close, .close = ppp_asynctty_close,
......
...@@ -365,7 +365,6 @@ ppp_sync_wakeup(struct tty_struct *tty) ...@@ -365,7 +365,6 @@ ppp_sync_wakeup(struct tty_struct *tty)
static struct tty_ldisc_ops ppp_sync_ldisc = { static struct tty_ldisc_ops ppp_sync_ldisc = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.magic = TTY_LDISC_MAGIC,
.name = "pppsync", .name = "pppsync",
.open = ppp_sync_open, .open = ppp_sync_open,
.close = ppp_sync_close, .close = ppp_sync_close,
......
...@@ -1263,7 +1263,6 @@ static int sl_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -1263,7 +1263,6 @@ static int sl_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
static struct tty_ldisc_ops sl_ldisc = { static struct tty_ldisc_ops sl_ldisc = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.magic = TTY_LDISC_MAGIC,
.name = "slip", .name = "slip",
.open = slip_open, .open = slip_open,
.close = slip_close, .close = slip_close,
......
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
#include <linux/pps_kernel.h> #include <linux/pps_kernel.h>
#include <linux/bug.h> #include <linux/bug.h>
#define PPS_TTY_MAGIC 0x0001
static void pps_tty_dcd_change(struct tty_struct *tty, unsigned int status) static void pps_tty_dcd_change(struct tty_struct *tty, unsigned int status)
{ {
struct pps_device *pps; struct pps_device *pps;
...@@ -114,7 +112,6 @@ static int __init pps_tty_init(void) ...@@ -114,7 +112,6 @@ static int __init pps_tty_init(void)
/* Init PPS_TTY data */ /* Init PPS_TTY data */
pps_ldisc_ops.owner = THIS_MODULE; pps_ldisc_ops.owner = THIS_MODULE;
pps_ldisc_ops.magic = PPS_TTY_MAGIC;
pps_ldisc_ops.name = "pps_tty"; pps_ldisc_ops.name = "pps_tty";
pps_ldisc_ops.dcd_change = pps_tty_dcd_change; pps_ldisc_ops.dcd_change = pps_tty_dcd_change;
pps_ldisc_ops.open = pps_tty_open; pps_ldisc_ops.open = pps_tty_open;
......
...@@ -2849,7 +2849,6 @@ static int gsm_create_network(struct gsm_dlci *dlci, struct gsm_netconfig *nc) ...@@ -2849,7 +2849,6 @@ static int gsm_create_network(struct gsm_dlci *dlci, struct gsm_netconfig *nc)
/* Line discipline for real tty */ /* Line discipline for real tty */
static struct tty_ldisc_ops tty_ldisc_packet = { static struct tty_ldisc_ops tty_ldisc_packet = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.magic = TTY_LDISC_MAGIC,
.name = "n_gsm", .name = "n_gsm",
.open = gsmld_open, .open = gsmld_open,
.close = gsmld_close, .close = gsmld_close,
......
...@@ -787,7 +787,6 @@ static struct n_hdlc_buf *n_hdlc_buf_get(struct n_hdlc_buf_list *buf_list) ...@@ -787,7 +787,6 @@ static struct n_hdlc_buf *n_hdlc_buf_get(struct n_hdlc_buf_list *buf_list)
static struct tty_ldisc_ops n_hdlc_ldisc = { static struct tty_ldisc_ops n_hdlc_ldisc = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.magic = TTY_LDISC_MAGIC,
.name = "hdlc", .name = "hdlc",
.open = n_hdlc_tty_open, .open = n_hdlc_tty_open,
.close = n_hdlc_tty_close, .close = n_hdlc_tty_close,
......
...@@ -40,7 +40,6 @@ static void n_null_receivebuf(struct tty_struct *tty, ...@@ -40,7 +40,6 @@ static void n_null_receivebuf(struct tty_struct *tty,
static struct tty_ldisc_ops null_ldisc = { static struct tty_ldisc_ops null_ldisc = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.magic = TTY_LDISC_MAGIC,
.name = "n_null", .name = "n_null",
.open = n_null_open, .open = n_null_open,
.close = n_null_close, .close = n_null_close,
......
...@@ -146,7 +146,6 @@ static void r3964_receive_buf(struct tty_struct *tty, const unsigned char *cp, ...@@ -146,7 +146,6 @@ static void r3964_receive_buf(struct tty_struct *tty, const unsigned char *cp,
static struct tty_ldisc_ops tty_ldisc_N_R3964 = { static struct tty_ldisc_ops tty_ldisc_N_R3964 = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.magic = TTY_LDISC_MAGIC,
.name = "R3964", .name = "R3964",
.open = r3964_open, .open = r3964_open,
.close = r3964_close, .close = r3964_close,
......
...@@ -2488,7 +2488,6 @@ static int n_tty_ioctl(struct tty_struct *tty, struct file *file, ...@@ -2488,7 +2488,6 @@ static int n_tty_ioctl(struct tty_struct *tty, struct file *file,
} }
static struct tty_ldisc_ops n_tty_ops = { static struct tty_ldisc_ops n_tty_ops = {
.magic = TTY_LDISC_MAGIC,
.name = "n_tty", .name = "n_tty",
.open = n_tty_open, .open = n_tty_open,
.close = n_tty_close, .close = n_tty_close,
......
...@@ -173,7 +173,6 @@ extern int ldsem_down_write_nested(struct ld_semaphore *sem, int subclass, ...@@ -173,7 +173,6 @@ extern int ldsem_down_write_nested(struct ld_semaphore *sem, int subclass,
struct tty_ldisc_ops { struct tty_ldisc_ops {
int magic;
char *name; char *name;
int num; int num;
int flags; int flags;
...@@ -218,8 +217,6 @@ struct tty_ldisc { ...@@ -218,8 +217,6 @@ struct tty_ldisc {
struct tty_struct *tty; struct tty_struct *tty;
}; };
#define TTY_LDISC_MAGIC 0x5403
#define LDISC_FLAG_DEFINED 0x00000001 #define LDISC_FLAG_DEFINED 0x00000001
#define MODULE_ALIAS_LDISC(ldisc) \ #define MODULE_ALIAS_LDISC(ldisc) \
......
...@@ -453,7 +453,6 @@ void nci_uart_set_config(struct nci_uart *nu, int baudrate, int flow_ctrl) ...@@ -453,7 +453,6 @@ void nci_uart_set_config(struct nci_uart *nu, int baudrate, int flow_ctrl)
EXPORT_SYMBOL_GPL(nci_uart_set_config); EXPORT_SYMBOL_GPL(nci_uart_set_config);
static struct tty_ldisc_ops nci_uart_ldisc = { static struct tty_ldisc_ops nci_uart_ldisc = {
.magic = TTY_LDISC_MAGIC,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "n_nci", .name = "n_nci",
.open = nci_uart_tty_open, .open = nci_uart_tty_open,
......
...@@ -285,7 +285,6 @@ static void v253_wakeup(struct tty_struct *tty) ...@@ -285,7 +285,6 @@ static void v253_wakeup(struct tty_struct *tty)
} }
struct tty_ldisc_ops v253_ops = { struct tty_ldisc_ops v253_ops = {
.magic = TTY_LDISC_MAGIC,
.name = "cx20442", .name = "cx20442",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = v253_open, .open = v253_open,
......
...@@ -395,7 +395,6 @@ static void cx81801_wakeup(struct tty_struct *tty) ...@@ -395,7 +395,6 @@ static void cx81801_wakeup(struct tty_struct *tty)
} }
static struct tty_ldisc_ops cx81801_ops = { static struct tty_ldisc_ops cx81801_ops = {
.magic = TTY_LDISC_MAGIC,
.name = "cx81801", .name = "cx81801",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = cx81801_open, .open = cx81801_open,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment