On Fri, Oct 21, 2022 at 02:25:52PM +0000, Klemens Nanni wrote:
> Not that big, but quirks are likely to grow in the feature and there is
> no reason to keep them writable:
> ffffffff822c0750 g O .data 0000000000000160 uvideo_devs
>
> Builds fine on amd64 but I don't have uvideo(4) attaching anywhere.
> OK?
No issues spotted with this diff.
ok mglocker@
> diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c
> index de4784beb63..f947ed56133 100644
> --- a/sys/dev/usb/uvideo.c
> +++ b/sys/dev/usb/uvideo.c
> @@ -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);
>