From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38F96C433DB for ; Thu, 11 Feb 2021 13:08:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E4F6164E08 for ; Thu, 11 Feb 2021 13:08:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231659AbhBKNHs (ORCPT ); Thu, 11 Feb 2021 08:07:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:59318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230394AbhBKNFY (ORCPT ); Thu, 11 Feb 2021 08:05:24 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7D45764E08; Thu, 11 Feb 2021 13:04:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613048683; bh=jK0NGxlElbE5VyNPYQUpDRF9ymi9Qy0NANIFxdScjjA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=zVff6b9KHJ9aF6aMWYNSIiteqeS1UC7v2lA6u/Rrhg0gbhSz5V1zVacniJyflr8mk lvSVy1ukCg1Bw+7zmEryKzP06VHZoe7DRzY78PZkg9Mp8QFVEMcATtTrJsJQdX4chi kFkydEWLK54mR48mR6Ngq+Kl31+0vBJYiyWkjs68= Date: Thu, 11 Feb 2021 14:04:40 +0100 From: Greg KH To: Sylvain Pelissier Cc: kopiga.rasiah@epfl.ch, linux-usb@vger.kernel.org, laurent.pinchart@ideasonboard.com Subject: Re: [PATCH] usb: video: fix descriptor structures macros Message-ID: References: <20210128081259.20940-1-sylvain.pelissier@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Thu, Feb 11, 2021 at 01:55:21PM +0100, Sylvain Pelissier wrote: > Le jeu. 11 févr. 2021 à 13:48, Greg KH a > écrit : > > > On Tue, Feb 09, 2021 at 05:16:45PM +0100, Sylvain Pelissier wrote: > > > On Thu, 28 Jan 2021 at 18:17, Sylvain Pelissier > > > wrote: > > > > > > > > On Thu, 28 Jan 2021 at 09:22, Greg KH > > wrote: > > > > > > > > > > On Thu, Jan 28, 2021 at 09:12:59AM +0100, Sylvain Pelissier wrote: > > > > > > The macros defining structures for descriptors use token > > > > > > pasting incorrectly. For example, the macro > > > > > > UVC_EXTENSION_UNIT_DESCRIPTOR(1, 2) defines a structure named > > > > > > uvc_extension_unit_descriptor_p_2 which should be > > > > > > uvc_extension_unit_descriptor_1_2 instead. > > > > > > > > > > > > Signed-off-by: Sylvain Pelissier > > > > > > --- > > > > > > include/uapi/linux/usb/video.h | 6 +++--- > > > > > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > > > > > > > > > diff --git a/include/uapi/linux/usb/video.h > > b/include/uapi/linux/usb/video.h > > > > > > index d854cb19c42c..1eb982df87a0 100644 > > > > > > --- a/include/uapi/linux/usb/video.h > > > > > > +++ b/include/uapi/linux/usb/video.h > > > > > > @@ -324,7 +324,7 @@ struct uvc_extension_unit_descriptor { > > > > > > #define UVC_DT_EXTENSION_UNIT_SIZE(p, n) (24+(p)+(n)) > > > > > > > > > > > > #define UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) \ > > > > > > - uvc_extension_unit_descriptor_##p_##n > > > > > > + uvc_extension_unit_descriptor_##p##_##n > > > > > > > > > > > > #define DECLARE_UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) \ > > > > > > struct UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) { \ > > > > > > @@ -371,7 +371,7 @@ struct uvc_input_header_descriptor { > > > > > > #define UVC_DT_INPUT_HEADER_SIZE(n, p) > > (13+(n*p)) > > > > > > > > > > > > #define UVC_INPUT_HEADER_DESCRIPTOR(n, p) \ > > > > > > - uvc_input_header_descriptor_##n_##p > > > > > > + uvc_input_header_descriptor_##n##_##p > > > > > > > > > > > > #define DECLARE_UVC_INPUT_HEADER_DESCRIPTOR(n, p) \ > > > > > > struct UVC_INPUT_HEADER_DESCRIPTOR(n, p) { \ > > > > > > @@ -406,7 +406,7 @@ struct uvc_output_header_descriptor { > > > > > > #define UVC_DT_OUTPUT_HEADER_SIZE(n, p) > > (9+(n*p)) > > > > > > > > > > > > #define UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) \ > > > > > > - uvc_output_header_descriptor_##n_##p > > > > > > + uvc_output_header_descriptor_##n##_##p > > > > > > > > > > > > #define DECLARE_UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) \ > > > > > > struct UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) { \ > > > > > > -- > > > > > > 2.25.1 > > > > > > > > > > > > > > > > And no one noticed this? If not, then why do we have these defines > > at > > > > > all, as obviously they are not used :) > > > > > > > > The problem is not detected if you have descriptors with the second > > > > argument different each time since the structure name will change. It > > > > is maybe why it was not noticed. Nevertheless, the extension unit, the > > > > input header and the output header descriptors are part of the USB > > > > video class specification and are often used by devices. We have > > > > detected the problem while implementing a usb gadget having such > > > > descriptors. > > > > > > > Hi, > > > Do I need to change something for this patch ? > > > > I need an ack from the v4l maintainers before I can take it... > > > > Do I need to add someone in cc in particular? I think Laurent is the proper one here as he's the maintainer for the usb v4l driver, right? thanks, greg k-h