From 59a708ba74246218e566235c0a5a9cbc8e1138ec Mon Sep 17 00:00:00 2001 From: kn Date: Fri, 21 Oct 2022 18:29:37 +0000 Subject: [PATCH] constify quirks table Not that big now, but quirks are likely to grow in the feature and there is no reason to keep them writable. OK and tested by mglocker --- sys/dev/usb/uvideo.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c index de4784beb63..7769034d800 100644 --- a/sys/dev/usb/uvideo.c +++ b/sys/dev/usb/uvideo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvideo.c,v 1.218 2022/08/15 01:35:07 jsg Exp $ */ +/* $OpenBSD: uvideo.c,v 1.219 2022/10/21 18:29:37 kn Exp $ */ /* * Copyright (c) 2008 Robert Nagy @@ -106,7 +106,7 @@ struct uvideo_softc { uint8_t *sc_uplayer_fbuffer; void (*sc_uplayer_intr)(void *); - struct uvideo_devs *sc_quirk; + const struct uvideo_devs *sc_quirk; usbd_status (*sc_decode_stream_header) (struct uvideo_softc *, uint8_t *, int); @@ -303,7 +303,7 @@ const struct video_hw_if uvideo_hw_if = { #define UVIDEO_FLAG_REATTACH 0x2 #define UVIDEO_FLAG_VENDOR_CLASS 0x4 #define UVIDEO_FLAG_NOATTACH 0x8 -struct uvideo_devs { +const struct uvideo_devs { struct usb_devno uv_dev; char *ucode_name; usbd_status (*ucode_loader)(struct uvideo_softc *); @@ -386,7 +386,7 @@ struct uvideo_devs { }, }; #define uvideo_lookup(v, p) \ - ((struct uvideo_devs *)usb_lookup(uvideo_devs, v, p)) + ((const struct uvideo_devs *)usb_lookup(uvideo_devs, v, p)) int uvideo_open(void *addr, int flags, int *size, uint8_t *buffer, @@ -440,7 +440,7 @@ uvideo_match(struct device *parent, void *match, void *aux) { struct usb_attach_arg *uaa = aux; usb_interface_descriptor_t *id; - struct uvideo_devs *quirk; + const struct uvideo_devs *quirk; if (uaa->iface == NULL) return (UMATCH_NONE); -- 2.20.1