From c520a48cc23c2654af7c9d96f1ddb9073e7223fc Mon Sep 17 00:00:00 2001 From: naddy Date: Sat, 9 Apr 2022 20:07:44 +0000 Subject: [PATCH] constify method tables in USB serial drivers ok miod@ --- sys/dev/usb/moscom.c | 4 ++-- sys/dev/usb/uark.c | 4 ++-- sys/dev/usb/ubsa.c | 4 ++-- sys/dev/usb/uchcom.c | 4 ++-- sys/dev/usb/ucom.c | 4 ++-- sys/dev/usb/ucomvar.h | 4 ++-- sys/dev/usb/ucrcom.c | 4 ++-- sys/dev/usb/ucycom.c | 4 ++-- sys/dev/usb/uftdi.c | 4 ++-- sys/dev/usb/uipaq.c | 4 ++-- sys/dev/usb/ukspan.c | 4 ++-- sys/dev/usb/umcs.c | 4 ++-- sys/dev/usb/umct.c | 4 ++-- sys/dev/usb/umodem.c | 4 ++-- sys/dev/usb/umsm.c | 4 ++-- sys/dev/usb/uplcom.c | 4 ++-- sys/dev/usb/uscom.c | 4 ++-- sys/dev/usb/uslcom.c | 4 ++-- sys/dev/usb/uslhcom.c | 4 ++-- sys/dev/usb/uticom.c | 4 ++-- sys/dev/usb/uvisor.c | 4 ++-- sys/dev/usb/uvscom.c | 4 ++-- sys/dev/usb/uxrcom.c | 4 ++-- 23 files changed, 46 insertions(+), 46 deletions(-) diff --git a/sys/dev/usb/moscom.c b/sys/dev/usb/moscom.c index 0f5d4bed40c..9e7f0549245 100644 --- a/sys/dev/usb/moscom.c +++ b/sys/dev/usb/moscom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: moscom.c,v 1.24 2016/09/02 09:14:59 mpi Exp $ */ +/* $OpenBSD: moscom.c,v 1.25 2022/04/09 20:07:44 naddy Exp $ */ /* * Copyright (c) 2006 Jonathan Gray @@ -145,7 +145,7 @@ int moscom_param(void *, int, struct termios *); int moscom_open(void *, int); int moscom_cmd(struct moscom_softc *, int, int); -struct ucom_methods moscom_methods = { +const struct ucom_methods moscom_methods = { NULL, moscom_set, moscom_param, diff --git a/sys/dev/usb/uark.c b/sys/dev/usb/uark.c index 10b5df793ce..043527bcae5 100644 --- a/sys/dev/usb/uark.c +++ b/sys/dev/usb/uark.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uark.c,v 1.24 2016/09/02 09:14:59 mpi Exp $ */ +/* $OpenBSD: uark.c,v 1.25 2022/04/09 20:07:44 naddy Exp $ */ /* * Copyright (c) 2006 Jonathan Gray @@ -72,7 +72,7 @@ int uark_param(void *, int, struct termios *); void uark_break(void *, int, int); int uark_cmd(struct uark_softc *, uint16_t, uint16_t); -struct ucom_methods uark_methods = { +const struct ucom_methods uark_methods = { uark_get_status, uark_set, uark_param, diff --git a/sys/dev/usb/ubsa.c b/sys/dev/usb/ubsa.c index 1ca8871433d..69fc2965211 100644 --- a/sys/dev/usb/ubsa.c +++ b/sys/dev/usb/ubsa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ubsa.c,v 1.67 2020/07/31 10:49:33 mglocker Exp $ */ +/* $OpenBSD: ubsa.c,v 1.68 2022/04/09 20:07:44 naddy Exp $ */ /* $NetBSD: ubsa.c,v 1.5 2002/11/25 00:51:33 fvdl Exp $ */ /*- * Copyright (c) 2002, Alexander Kabaev . @@ -178,7 +178,7 @@ void ubsa_databits(struct ubsa_softc *, tcflag_t); void ubsa_stopbits(struct ubsa_softc *, tcflag_t); void ubsa_flow(struct ubsa_softc *, tcflag_t, tcflag_t); -struct ucom_methods ubsa_methods = { +const struct ucom_methods ubsa_methods = { ubsa_get_status, ubsa_set, ubsa_param, diff --git a/sys/dev/usb/uchcom.c b/sys/dev/usb/uchcom.c index 654b891542c..d67c2775679 100644 --- a/sys/dev/usb/uchcom.c +++ b/sys/dev/usb/uchcom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uchcom.c,v 1.32 2022/01/26 12:05:33 uaa Exp $ */ +/* $OpenBSD: uchcom.c,v 1.33 2022/04/09 20:07:44 naddy Exp $ */ /* $NetBSD: uchcom.c,v 1.1 2007/09/03 17:57:37 tshiozak Exp $ */ /* @@ -215,7 +215,7 @@ int uchcom_match(struct device *, void *, void *); void uchcom_attach(struct device *, struct device *, void *); int uchcom_detach(struct device *, int); -struct ucom_methods uchcom_methods = { +const struct ucom_methods uchcom_methods = { uchcom_get_status, uchcom_set, uchcom_param, diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c index 8a4482fac9b..ed3a2a431b1 100644 --- a/sys/dev/usb/ucom.c +++ b/sys/dev/usb/ucom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ucom.c,v 1.71 2020/07/31 10:49:33 mglocker Exp $ */ +/* $OpenBSD: ucom.c,v 1.72 2022/04/09 20:07:44 naddy Exp $ */ /* $NetBSD: ucom.c,v 1.49 2003/01/01 00:10:25 thorpej Exp $ */ /* @@ -102,7 +102,7 @@ struct ucom_softc { struct usbd_pipe *sc_ipipe; /* hid interrupt input pipe */ struct usbd_pipe *sc_opipe; /* hid interrupt pipe */ - struct ucom_methods *sc_methods; + const struct ucom_methods *sc_methods; void *sc_parent; int sc_portno; diff --git a/sys/dev/usb/ucomvar.h b/sys/dev/usb/ucomvar.h index 216725b439b..0877c2f0d94 100644 --- a/sys/dev/usb/ucomvar.h +++ b/sys/dev/usb/ucomvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ucomvar.h,v 1.18 2013/04/15 09:23:02 mglocker Exp $ */ +/* $OpenBSD: ucomvar.h,v 1.19 2022/04/09 20:07:44 naddy Exp $ */ /* $NetBSD: ucomvar.h,v 1.10 2001/12/31 12:15:21 augustss Exp $ */ /* @@ -93,7 +93,7 @@ struct ucom_attach_args { const char *info; /* attach message */ struct usbd_device *device; struct usbd_interface *iface; - struct ucom_methods *methods; + const struct ucom_methods *methods; void *arg; }; diff --git a/sys/dev/usb/ucrcom.c b/sys/dev/usb/ucrcom.c index 4136a4752bd..34654197a76 100644 --- a/sys/dev/usb/ucrcom.c +++ b/sys/dev/usb/ucrcom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ucrcom.c,v 1.1 2019/05/08 23:53:40 kettenis Exp $ */ +/* $OpenBSD: ucrcom.c,v 1.2 2022/04/09 20:07:44 naddy Exp $ */ /* * Copyright (c) 2019 Mark Kettenis @@ -36,7 +36,7 @@ struct ucrcom_softc { struct device *sc_subdev; }; -struct ucom_methods ucrcom_methods = { NULL }; +const struct ucom_methods ucrcom_methods = { NULL }; int ucrcom_match(struct device *, void *, void *); void ucrcom_attach(struct device *, struct device *, void *); diff --git a/sys/dev/usb/ucycom.c b/sys/dev/usb/ucycom.c index cd1feaeedc0..0eb2455e3df 100644 --- a/sys/dev/usb/ucycom.c +++ b/sys/dev/usb/ucycom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ucycom.c,v 1.40 2021/11/15 15:36:24 anton Exp $ */ +/* $OpenBSD: ucycom.c,v 1.41 2022/04/09 20:07:44 naddy Exp $ */ /* $NetBSD: ucycom.c,v 1.3 2005/08/05 07:27:47 skrll Exp $ */ /* @@ -129,7 +129,7 @@ void ucycom_close(void *, int); void ucycom_write(void *, int, u_char *, u_char *, u_int32_t *); void ucycom_read(void *, int, u_char **, u_int32_t *); -struct ucom_methods ucycom_methods = { +const struct ucom_methods ucycom_methods = { NULL, /* ucycom_get_status, */ ucycom_set, ucycom_param, diff --git a/sys/dev/usb/uftdi.c b/sys/dev/usb/uftdi.c index fb7b8ae8621..9a0ee7823ab 100644 --- a/sys/dev/usb/uftdi.c +++ b/sys/dev/usb/uftdi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uftdi.c,v 1.76 2020/02/22 14:01:34 jasper Exp $ */ +/* $OpenBSD: uftdi.c,v 1.77 2022/04/09 20:07:44 naddy Exp $ */ /* $NetBSD: uftdi.c,v 1.14 2003/02/23 04:20:07 simonb Exp $ */ /* @@ -100,7 +100,7 @@ void uftdi_break(void *sc, int portno, int onoff); int uftdi_8u232am_getrate(speed_t speed, int *rate); int uftdi_2232h_getrate(speed_t speed, int *rate); -struct ucom_methods uftdi_methods = { +const struct ucom_methods uftdi_methods = { uftdi_get_status, uftdi_set, uftdi_param, diff --git a/sys/dev/usb/uipaq.c b/sys/dev/usb/uipaq.c index 7ab16eb894e..c5aa8a03c09 100644 --- a/sys/dev/usb/uipaq.c +++ b/sys/dev/usb/uipaq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipaq.c,v 1.27 2020/02/22 14:01:34 jasper Exp $ */ +/* $OpenBSD: uipaq.c,v 1.28 2022/04/09 20:07:44 naddy Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -94,7 +94,7 @@ void uipaq_rts(struct uipaq_softc *sc, int onoff); void uipaq_break(struct uipaq_softc* sc, int onoff); -struct ucom_methods uipaq_methods = { +const struct ucom_methods uipaq_methods = { NULL, uipaq_set, NULL, diff --git a/sys/dev/usb/ukspan.c b/sys/dev/usb/ukspan.c index be42faf696e..979ffa7ef55 100644 --- a/sys/dev/usb/ukspan.c +++ b/sys/dev/usb/ukspan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ukspan.c,v 1.3 2020/02/17 19:29:55 jasper Exp $ */ +/* $OpenBSD: ukspan.c,v 1.4 2022/04/09 20:07:44 naddy Exp $ */ /* * Copyright (c) 2019 Cody Cutler @@ -172,7 +172,7 @@ static const struct usb_devno ukspan_devs[] = { { USB_VENDOR_KEYSPAN, USB_PRODUCT_KEYSPAN_USA19HS }, }; -static struct ucom_methods ukspan_methods = { +static const struct ucom_methods ukspan_methods = { .ucom_get_status = ukspan_get_status, .ucom_set = ukspan_set, .ucom_param = ukspan_param, diff --git a/sys/dev/usb/umcs.c b/sys/dev/usb/umcs.c index fffbf1f9416..163625257cd 100644 --- a/sys/dev/usb/umcs.c +++ b/sys/dev/usb/umcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umcs.c,v 1.9 2022/01/09 05:43:01 jsg Exp $ */ +/* $OpenBSD: umcs.c,v 1.10 2022/04/09 20:07:44 naddy Exp $ */ /* $NetBSD: umcs.c,v 1.8 2014/08/23 21:37:56 martin Exp $ */ /* $FreeBSD: head/sys/dev/usb/serial/umcs.c 260559 2014-01-12 11:44:28Z hselasky $ */ @@ -119,7 +119,7 @@ int umcs_param(void *, int, struct termios *); int umcs_open(void *, int); void umcs_close(void *, int); -struct ucom_methods umcs_methods = { +const struct ucom_methods umcs_methods = { umcs_get_status, umcs_set, umcs_param, diff --git a/sys/dev/usb/umct.c b/sys/dev/usb/umct.c index 01a4301eadc..c97bf622fce 100644 --- a/sys/dev/usb/umct.c +++ b/sys/dev/usb/umct.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umct.c,v 1.48 2020/07/31 10:49:33 mglocker Exp $ */ +/* $OpenBSD: umct.c,v 1.49 2022/04/09 20:07:44 naddy Exp $ */ /* $NetBSD: umct.c,v 1.10 2003/02/23 04:20:07 simonb Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -116,7 +116,7 @@ int umct_param(void *, int, struct termios *); int umct_open(void *, int); void umct_close(void *, int); -struct ucom_methods umct_methods = { +const struct ucom_methods umct_methods = { umct_get_status, umct_set, umct_param, diff --git a/sys/dev/usb/umodem.c b/sys/dev/usb/umodem.c index 42bd3efa4ac..3906bbbe193 100644 --- a/sys/dev/usb/umodem.c +++ b/sys/dev/usb/umodem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umodem.c,v 1.67 2021/01/29 17:12:19 sthen Exp $ */ +/* $OpenBSD: umodem.c,v 1.68 2022/04/09 20:07:44 naddy Exp $ */ /* $NetBSD: umodem.c,v 1.45 2002/09/23 05:51:23 simonb Exp $ */ /* @@ -121,7 +121,7 @@ int umodem_open(void *, int portno); void umodem_close(void *, int portno); void umodem_intr(struct usbd_xfer *, void *, usbd_status); -struct ucom_methods umodem_methods = { +const struct ucom_methods umodem_methods = { umodem_get_status, umodem_set, umodem_param, diff --git a/sys/dev/usb/umsm.c b/sys/dev/usb/umsm.c index 50d92171214..9d49f9dcdbf 100644 --- a/sys/dev/usb/umsm.c +++ b/sys/dev/usb/umsm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umsm.c,v 1.120 2022/01/09 05:43:01 jsg Exp $ */ +/* $OpenBSD: umsm.c,v 1.121 2022/04/09 20:07:44 naddy Exp $ */ /* * Copyright (c) 2008 Yojiro UO @@ -83,7 +83,7 @@ usbd_status umsm_huawei_changemode(struct usbd_device *); usbd_status umsm_truinstall_changemode(struct usbd_device *); usbd_status umsm_umass_changemode(struct umsm_softc *); -struct ucom_methods umsm_methods = { +const struct ucom_methods umsm_methods = { umsm_get_status, umsm_set, NULL, diff --git a/sys/dev/usb/uplcom.c b/sys/dev/usb/uplcom.c index e1988464d66..c182279e94e 100644 --- a/sys/dev/usb/uplcom.c +++ b/sys/dev/usb/uplcom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uplcom.c,v 1.78 2021/10/29 14:25:05 jsg Exp $ */ +/* $OpenBSD: uplcom.c,v 1.79 2022/04/09 20:07:44 naddy Exp $ */ /* $NetBSD: uplcom.c,v 1.29 2002/09/23 05:51:23 simonb Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -129,7 +129,7 @@ int uplcom_param(void *, int, struct termios *); int uplcom_open(void *, int); void uplcom_close(void *, int); -struct ucom_methods uplcom_methods = { +const struct ucom_methods uplcom_methods = { uplcom_get_status, uplcom_set, uplcom_param, diff --git a/sys/dev/usb/uscom.c b/sys/dev/usb/uscom.c index 0d9e09a58e6..fc2c06a7415 100644 --- a/sys/dev/usb/uscom.c +++ b/sys/dev/usb/uscom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uscom.c,v 1.7 2019/02/24 17:36:28 patrick Exp $ */ +/* $OpenBSD: uscom.c,v 1.8 2022/04/09 20:07:44 naddy Exp $ */ /* * Copyright (c) 2006 Jonathan Gray @@ -40,7 +40,7 @@ struct uscom_softc { struct device *sc_subdev; }; -struct ucom_methods uscom_methods = { +const struct ucom_methods uscom_methods = { NULL, NULL, NULL, diff --git a/sys/dev/usb/uslcom.c b/sys/dev/usb/uslcom.c index bafd5479adf..5a14e9ef033 100644 --- a/sys/dev/usb/uslcom.c +++ b/sys/dev/usb/uslcom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uslcom.c,v 1.43 2021/12/13 13:57:48 visa Exp $ */ +/* $OpenBSD: uslcom.c,v 1.44 2022/04/09 20:07:44 naddy Exp $ */ /* * Copyright (c) 2006 Jonathan Gray @@ -99,7 +99,7 @@ int uslcom_open(void *sc, int portno); void uslcom_close(void *, int); void uslcom_break(void *sc, int portno, int onoff); -struct ucom_methods uslcom_methods = { +const struct ucom_methods uslcom_methods = { uslcom_get_status, uslcom_set, uslcom_param, diff --git a/sys/dev/usb/uslhcom.c b/sys/dev/usb/uslhcom.c index e818205d755..9e45cfdf526 100644 --- a/sys/dev/usb/uslhcom.c +++ b/sys/dev/usb/uslhcom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uslhcom.c,v 1.8 2021/11/15 15:36:24 anton Exp $ */ +/* $OpenBSD: uslhcom.c,v 1.9 2022/04/09 20:07:44 naddy Exp $ */ /* * Copyright (c) 2015 SASANO Takayoshi @@ -81,7 +81,7 @@ void uslhcom_set_baud_rate(struct uslhcom_uart_config *, u_int32_t); int uslhcom_create_config(struct uslhcom_uart_config *, struct termios *); int uslhcom_setup(struct uslhcom_softc *, struct uslhcom_uart_config *); -struct ucom_methods uslhcom_methods = { +const struct ucom_methods uslhcom_methods = { uslhcom_get_status, uslhcom_set, uslhcom_param, diff --git a/sys/dev/usb/uticom.c b/sys/dev/usb/uticom.c index 09889b43707..b2964acaee9 100644 --- a/sys/dev/usb/uticom.c +++ b/sys/dev/usb/uticom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uticom.c,v 1.34 2020/07/31 10:49:33 mglocker Exp $ */ +/* $OpenBSD: uticom.c,v 1.35 2022/04/09 20:07:44 naddy Exp $ */ /* * Copyright (c) 2005 Dmitry Komissaroff . * @@ -154,7 +154,7 @@ void uticom_attach_hook(struct device *); static int uticom_download_fw(struct uticom_softc *sc, int pipeno, struct usbd_device *dev); -struct ucom_methods uticom_methods = { +const struct ucom_methods uticom_methods = { uticom_get_status, uticom_set, uticom_param, diff --git a/sys/dev/usb/uvisor.c b/sys/dev/usb/uvisor.c index 9d704d88bc4..c3ed21fcfee 100644 --- a/sys/dev/usb/uvisor.c +++ b/sys/dev/usb/uvisor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvisor.c,v 1.52 2020/02/22 14:01:35 jasper Exp $ */ +/* $OpenBSD: uvisor.c,v 1.53 2022/04/09 20:07:44 naddy Exp $ */ /* $NetBSD: uvisor.c,v 1.21 2003/08/03 21:59:26 nathanw Exp $ */ /* @@ -145,7 +145,7 @@ usbd_status uvisor_init(struct uvisor_softc *, void uvisor_close(void *, int); -struct ucom_methods uvisor_methods = { +const struct ucom_methods uvisor_methods = { NULL, NULL, NULL, diff --git a/sys/dev/usb/uvscom.c b/sys/dev/usb/uvscom.c index eb55fa12210..d64f7495a30 100644 --- a/sys/dev/usb/uvscom.c +++ b/sys/dev/usb/uvscom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvscom.c,v 1.40 2022/01/09 05:43:02 jsg Exp $ */ +/* $OpenBSD: uvscom.c,v 1.41 2022/04/09 20:07:44 naddy Exp $ */ /* $NetBSD: uvscom.c,v 1.9 2003/02/12 15:36:20 ichiro Exp $ */ /*- * Copyright (c) 2001-2002, Shunsuke Akiyama . @@ -173,7 +173,7 @@ int uvscom_param(void *, int, struct termios *); int uvscom_open(void *, int); void uvscom_close(void *, int); -struct ucom_methods uvscom_methods = { +const struct ucom_methods uvscom_methods = { uvscom_get_status, uvscom_set, uvscom_param, diff --git a/sys/dev/usb/uxrcom.c b/sys/dev/usb/uxrcom.c index b0f4c6aafa6..70d07bb3cb6 100644 --- a/sys/dev/usb/uxrcom.c +++ b/sys/dev/usb/uxrcom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uxrcom.c,v 1.2 2020/07/31 10:49:33 mglocker Exp $ */ +/* $OpenBSD: uxrcom.c,v 1.3 2022/04/09 20:07:44 naddy Exp $ */ /* * Copyright (c) 2006 Jonathan Gray @@ -80,7 +80,7 @@ void uxrcom_close(void *, int); void uxrcom_break(void *, int, int); void uxrcom_intr(struct usbd_xfer *, void *, usbd_status); -struct ucom_methods uxrcom_methods = { +const struct ucom_methods uxrcom_methods = { uxrcom_get_status, uxrcom_set, uxrcom_param, -- 2.20.1