This constifies the ucom method tables in the USB serial adapter drivers, i.e., moves another kilobyte of function pointers into read-only space.
ok? diff 4df278d953b03573222cb39b422e005d4701614e b29fcdeeb3e7dfaa7565194eb526a7ece255a8a8 blob - 0f5d4bed40c58062bd043d0366485629d59c53cd blob + bb96ad9ba3263b2647683d45bbb429ee0821c66e --- sys/dev/usb/moscom.c +++ sys/dev/usb/moscom.c @@ -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, blob - 10b5df793ce6c39a343cedc1b375831fd7111fa9 blob + 02460365a0dbdd5f7dea9adb18da1667f224a2cb --- sys/dev/usb/uark.c +++ sys/dev/usb/uark.c @@ -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, blob - 1ca8871433d18ee8f427b1d25179e04e57e01c74 blob + 537ce7248f148f73e7343eaa041e15de8ec3eac6 --- sys/dev/usb/ubsa.c +++ sys/dev/usb/ubsa.c @@ -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, blob - 654b891542c81e1728ff9c49813441fe2da45048 blob + c8582f320d5756565f5b0e0398f7a91c4496d415 --- sys/dev/usb/uchcom.c +++ sys/dev/usb/uchcom.c @@ -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, blob - 8a4482fac9b511186211a5c3c83421da3db249b8 blob + 90fa0e99d53283b3d05b62d506a8bc0265698550 --- sys/dev/usb/ucom.c +++ sys/dev/usb/ucom.c @@ -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; blob - 216725b439b347c9acc33a5ff3c46a6ac1a49aea blob + 321eed5ce3d61e64ed374b74f0555941e4a61f6b --- sys/dev/usb/ucomvar.h +++ sys/dev/usb/ucomvar.h @@ -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; }; blob - 4136a4752bd02d1ff2baf1665825a5b88339a782 blob + 9d17df368adb089ba19af989396808651720f271 --- sys/dev/usb/ucrcom.c +++ sys/dev/usb/ucrcom.c @@ -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 *); blob - cd1feaeedc005b29b1ec3b15388d0ea4fb3578e7 blob + d3bd683db41e947ada0caf3db8e8a5ea1caaa8bd --- sys/dev/usb/ucycom.c +++ sys/dev/usb/ucycom.c @@ -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, blob - fb7b8ae8621207b77e449e1461ad0fab764f1378 blob + 2e3f33863d4e3f91459a29a3bff05c585fdba167 --- sys/dev/usb/uftdi.c +++ sys/dev/usb/uftdi.c @@ -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, blob - 7ab16eb894ec27b7ad3e4c4783b342cffcd273c1 blob + dc2321ebfc86883ca67de5f913e3c6acc7eb4434 --- sys/dev/usb/uipaq.c +++ sys/dev/usb/uipaq.c @@ -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, blob - be42faf696ebae3710e7aafe33a77481e28c9cfa blob + 2f7dc60b684168fac1dcef7c67db9d84088678a8 --- sys/dev/usb/ukspan.c +++ sys/dev/usb/ukspan.c @@ -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, blob - fffbf1f9416f29e74912fd14382f4bb46b44fe32 blob + 867f9506bbf4bd8c9f48a7f69aa6864f21a2c2c5 --- sys/dev/usb/umcs.c +++ sys/dev/usb/umcs.c @@ -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, blob - 01a4301eadc19eff98c93d61733912e08804905c blob + 9a33c8925995e62f87073b4235a827488afdea04 --- sys/dev/usb/umct.c +++ sys/dev/usb/umct.c @@ -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, blob - 42bd3efa4ac930407ae242c8e7f214022ce98b6e blob + c1fcecc63d687eb8b48bce496312b4756a41350b --- sys/dev/usb/umodem.c +++ sys/dev/usb/umodem.c @@ -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, blob - 50d92171214af541b0cb5df90029aa16875a759d blob + 8c5f279a364dada019ea83397d905e6ce35759b2 --- sys/dev/usb/umsm.c +++ sys/dev/usb/umsm.c @@ -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, blob - e1988464d668a2c777b16d2c8e3d76b279844e14 blob + 40013c454e2c493c33b4e8858947a296a708a9d9 --- sys/dev/usb/uplcom.c +++ sys/dev/usb/uplcom.c @@ -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, blob - 0d9e09a58e694533a34f12d5d5aff7e263d50063 blob + ff1e5a68ac65628c4f8a92b61b440fba648f421c --- sys/dev/usb/uscom.c +++ sys/dev/usb/uscom.c @@ -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, blob - bafd5479adfc4efa5996477569e8538900ffe85a blob + 9c00496ac024cb2bdd96f11f91575374d7dc4e0a --- sys/dev/usb/uslcom.c +++ sys/dev/usb/uslcom.c @@ -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, blob - e818205d75539092f303bd602f13678970a4fdce blob + 3595789541368937cd94db1b1362918ed60a5d1a --- sys/dev/usb/uslhcom.c +++ sys/dev/usb/uslhcom.c @@ -81,7 +81,7 @@ void uslhcom_set_baud_rate(struct uslhcom_uart_config 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, blob - 09889b43707305dbff14cc5596dbb748c2fbbb68 blob + a13ced27ff7b0138cea9987ef1928410b8685bc3 --- sys/dev/usb/uticom.c +++ sys/dev/usb/uticom.c @@ -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, blob - 9d704d88bc4170241473a52725c9310cc7f675b6 blob + 47de41622a654418c52220566205d3decc7aee92 --- sys/dev/usb/uvisor.c +++ sys/dev/usb/uvisor.c @@ -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, blob - eb55fa12210caacb079159c9365ea27bed498350 blob + c5162f2792356dc920bfe2160e461fc5b178490d --- sys/dev/usb/uvscom.c +++ sys/dev/usb/uvscom.c @@ -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, blob - b0f4c6aafa64379aec40cdb424ae0a9694c7be9c blob + 5c93c0b4f7c612785ecc533160a9330f0361bd9e --- sys/dev/usb/uxrcom.c +++ sys/dev/usb/uxrcom.c @@ -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, -- Christian "naddy" Weisgerber na...@mips.inka.de