From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796048211; b=fMmvAzTvjIyWNgO0Fqy4OwI23qIrhKgxfXz51pxBbZ4CFB8n2Ynz870x5vs4PPTvrwBX 4lRNSR6HO9XNiRFyjN68Z5gK1heGO2hJ+TvXD95Lk3XV9xPviEUQtEV67Yt6+2iAfIxBE a09PmWfb64Um2Vn1xBhu1qKxxg3wCD4TEqgs4cga744Ad/iMM9kx0sTz7IgONGeT4bngr yScY8HqSbGRMuoH3NzwLS59HtwYaPSoX8tze41Q/30rRKJfPvwC1NRST8uhhrHjx2i8IP lcsw5GjpyKJwAKM7SS0996XC1t0v3Bz3Yu8HjU0Cbk010+Fd+QmZLknw4GZyl6GJI1A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796048211; h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:From:Content-Language:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=03vKIBa8Sqtiwc6+9paFB2L81c4C2LfcEoRhH8mkJqI=; b=4hYqkbJtN46SlFhsDEOpfRpW4vMYWT4CFfFDcBF9YQdHMKrk8rIAFJ8npBSSXoFclVwN KqolyVrz0F0WzR7nKpPKyeXGlb2/STiW1A+1zrWMoY6rqY/GAeD7zh1yGh3JAHKwEOlqq qiHjxOg5bCKZ5RMLHZUt2fTv3A3LmLDkrSau4356a0xlyq3C+ZWMIGzYQLWp5DyXzMwjW YCBrzsezMIbYAI/O2BiXpZCsaSfFakswtmb6pM0I7TyNorZwWoZhIOtjU/EIJ/9y4f3Oc hzDn/aWRPqwnUfgtWsAxiFob5+jB1MzEzFfxJ+e56d403k+yOuwhABv4tQoL8vE75JQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=RjbrPBjk; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43747606A327; Mon, 30 Nov 2026 14:16:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=RjbrPBjk Received: by smtp.kernel.org (Postfix) with ESMTPSA id C56E41F00896; Mon, 30 Nov 2026 14:16:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796048210; bh=03vKIBa8Sqtiwc6+9paFB2L81c4C2LfcEoRhH8mkJqI=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=RjbrPBjkUAzn4XRvWjt3a+922FyNoCdS+hmxLvrZPm5BvMkV0PUFcdDkYxbVuSuU9 j054pURSWsUc8a1BvMa2FCEu9XsGyEzYRtf0xEGaQWxlTMStaCMndPS3RnbLZyjc1Q yxEF6HQcrOJN/mtH/spCQSc0Cb+zgJQh91Uev/CrUopzt74SpLb51N8KyTbDeIcbJY UzSsMQCRkgKicS1ku2koVuZF6J+VMcrojDkrmP0RjYO+sNyhBB4ix/XleQ6fT/qnpA 4JYt0iIzVVs/u2a/kK+FxLMm44TlEW+OfPqO5Hq3ekqcvaheBYZNAR9mtKSp666GCh W/c7kkIdsEMfg== Message-ID: <574cdec6-2429-4caa-a8ea-6a9cc7a57fe5@kernel.org> Date: Mon, 30 Nov 2026 15:16:48 +0100 X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] media: uvcvideo: Use USB_DEVICE_AND_INTERFACE_INFO macro To: Ricardo Ribalda , Laurent Pinchart Cc: Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org References: <20261002-uvc-sorted-v1-0-65f52e4d7e16@chromium.org> <20261002-uvc-sorted-v1-1-65f52e4d7e16@chromium.org> <20261130133458.GC91231@killaraus.ideasonboard.com> From: Hans de Goede Content-Language: en-US, nl In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, On 30-Nov-26 14:50, Ricardo Ribalda wrote: > Hi Laurent > > > On Mon, 30 Nov 2026 at 14:35, Laurent Pinchart > wrote: >> >> On Fri, Oct 02, 2026 at 03:29:05PM +0000, Ricardo Ribalda wrote: >>> It makes the code arguably nicer and also add some structure that we can >>> later use to automate checking for the quirks ordering. >>> >>> It also introduces a new macro UVC_INFO_VERSION to make the code even >>> nicer. >>> >>> This does not introduce any change in the code: >>> $ diff <(objdump -S drivers/media/usb/uvc/uvc_driver.o) \ >>> <(objdump -S drivers/media/usb/uvc/uvc_driver.o.patched) >> >> Wow, I didn't know anyone still used non-unified diffs :-) >> >>> 2c2 >>> < drivers/media/usb/uvc/uvc_driver.o: file format elf64-x86-64 >>> --- >>>> drivers/media/usb/uvc/uvc_driver.o.patched: file format elf64-x86-64 >>> $ >>> >>> Signed-off-by: Ricardo Ribalda >>> --- >>> drivers/media/usb/uvc/uvc_driver.c | 704 ++++++------------------------------- >>> 1 file changed, 107 insertions(+), 597 deletions(-) >>> >>> diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c >>> index cbc14569716b..b789bc55e02b 100644 >>> --- a/drivers/media/usb/uvc/uvc_driver.c >>> +++ b/drivers/media/usb/uvc/uvc_driver.c >>> @@ -2539,6 +2539,8 @@ static const struct uvc_device_info uvc_quirk_force_y8 = { >>> #define UVC_INFO_QUIRK(q) (kernel_ulong_t)&(struct uvc_device_info){.quirks = q} >>> #define UVC_INFO_META(m) (kernel_ulong_t)&(struct uvc_device_info) \ >>> {.meta_format = m} >>> +#define UVC_INFO_VERSION(v) (kernel_ulong_t)&(const struct uvc_device_info) \ >>> + {.uvc_version = v} >>> >>> /* >>> * The Logitech cameras listed below have their interface class set to >>> @@ -2549,556 +2551,195 @@ static const struct uvc_device_info uvc_quirk_force_y8 = { >>> */ >>> static const struct usb_device_id uvc_ids[] = { >>> /* HP Webcam HD 2300 */ >>> - { .match_flags = USB_DEVICE_ID_MATCH_DEVICE >>> - | USB_DEVICE_ID_MATCH_INT_INFO, >>> - .idVendor = 0x03f0, >>> - .idProduct = 0xe207, >>> - .bInterfaceClass = USB_CLASS_VIDEO, >>> - .bInterfaceSubClass = 1, >>> - .bInterfaceProtocol = 0, >>> + { USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0xe207, USB_CLASS_VIDEO, 1, 0), >> >> We could introduce a UVC_DEVICE_AND_INTERFACE_INFO() macro: >> >> #define UVC_DEVICE_AND_INTERFACE_INFO(vend, prod, pr) \ >> USB_DEVICE_AND_INTERFACE_INFO(vend, prod, USB_CLASS_VIDEO, 1, pr) >> >> to further shorten the lines. However, there are 9 entries that use >> USB_CLASS_VENDOR_SPEC. Would keeping USB_DEVICE_AND_INTERFACE_INFO() >> foor those break your sorting tool ? > > Yeah, I think it will break the nice sorting rule as is, or it will > require that we use an obscure regex > https://github.com/google/keep-sorted#regular-expressions > > I'd rather relax the 80 column rule for the quirks... but you probably > won't like that. FWIW I'm fine with relaxing the 80 columns rule for the USB_DEVICE_AND_INTERFACE_INFO() lines. Regards, Hans