Message ID | 20240725061034.461-2-nas.chung@chipsnmedia.com (mailing list archive) |
---|---|
State | New |
Delegated to: | Sebastian Fricke |
Headers |
Received: from sy.mirrors.kernel.org ([147.75.48.161]) by linuxtv.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from <linux-media+bounces-15325-patchwork=linuxtv.org@vger.kernel.org>) id 1sWrhC-0001s9-2D for patchwork@linuxtv.org; Thu, 25 Jul 2024 06:11:23 +0000 Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B6684B2280E for <patchwork@linuxtv.org>; Thu, 25 Jul 2024 06:11:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E650A16C862; Thu, 25 Jul 2024 06:11:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chipsnmedia.com header.i=@chipsnmedia.com header.b="ZNUCPlpM" X-Original-To: linux-media@vger.kernel.org Received: from SE2P216CU007.outbound.protection.outlook.com (mail-koreacentralazon11021106.outbound.protection.outlook.com [40.107.42.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5159C15FD13; Thu, 25 Jul 2024 06:10:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.42.106 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721887860; cv=fail; b=fPlXqYKwTgr8qkhc/IFSJSVSJGlopn8XV7pDayiAsLS2NvvbWmehDu02jpn0Nlv0o0TpnuOpakNWJ11uGZYt0L85Hf7VI77J4g/AzsrvZdBs6KxZMyHqt/Yrme2t+ZS3hmiY9qj6ENBOfPWYbxWr327PvIERB2avQBACALS+LnE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721887860; c=relaxed/simple; bh=D970LIGCthGR0/ri/6BUJJAKhO2QNrqEJvBqMuiTp5Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=e5W0cMfcQu8hPtw1IfK3iY9kZgUL6dPQ/glu55yPT+FGTU/MycV1yMGHldZuzvt4abw+I8oIRbpP3QW/uRdy+8jEq8TeD3lIuZtmaQy4NIKZHvG+KnVzlI3vZksLH491S2vYzR9+caRs5n/JzpqwR3Rf09JXBflf3uTQ3qQ8GwE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=chipsnmedia.com; spf=pass smtp.mailfrom=chipsnmedia.com; dkim=pass (1024-bit key) header.d=chipsnmedia.com header.i=@chipsnmedia.com header.b=ZNUCPlpM; arc=fail smtp.client-ip=40.107.42.106 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=chipsnmedia.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chipsnmedia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MaPAN9TIPuFIF7VJNHMhfE3a8ROu69YiVGs/lwoCUDTsmtghjFNxunnHMaVXotUF4DZFTtImEQbJe9RA6431QlT1u1/Ta9L7EUNGu9vWbJhxI4JuPuwtz8r3R3HfmOc2P8+jDQgfMjkL+5RW0hJAIE+NBHvXwBEpni9dEFILv3yR1xE2Jb/kT/sxp1+jkRKIEj9q0nhiLKk8rjcMLKcterDvz/WopOwiJJSzrq2URCoyV2yeFbu8oI6HuDtosI+6HH1TO+CwxnWv8w3Psv92i5Z2y5qfuGpwAa1S0387qSOzYw6B1G+uc5gpaVpME1twV+GdWG7rLUhxTN4VueD+MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VgcflCY42THp8S1Gu+oZl2RHDtAv7azYbU8IBdtVXkM=; b=TuA0urpilnjYZtAGZzIwSCPouhvokE6XL99M/BuUjexAkxYKEhKahTT6nRUJ4gEtHTNOWiVhIvqVJGavY/pixKO0Pb60M1YQI8KXQZIm6ixqaek4OESAeosGuvLEuaWBUYInAWQI+9yU+LsQ0bt2st443C8v4pIx6+M/C8wcXViyqbrp1oTDTCcdgP34p3e1lyqwODeYQPBWjBaedqRSZsrYTQAJSvijLrbMzfihDdtl34GXZAqQ/YjMWWndWVne5x2JBjvvji/jJFrJYD0ctB+8TunfLQBxmk6oNdEEArmggtFRNtUq28GLX/SExdQEZlm2Rng0gJE9NS55gB+RqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=chipsnmedia.com; dmarc=pass action=none header.from=chipsnmedia.com; dkim=pass header.d=chipsnmedia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chipsnmedia.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VgcflCY42THp8S1Gu+oZl2RHDtAv7azYbU8IBdtVXkM=; b=ZNUCPlpM6KhydQegSmBul0w/tf0njINW9gqUeVG0+3Mqy5Q27HA1V3/renaWmNWeOn2CInttxC3BFvxwrUO2LcDdyVjyDzGJyjhMC+ystr0+0dD+2kAH6f8exVc8vRjJsaCSNIAefct64/Zdw+bOHTTijO7daULeRH53HBJ7nmg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=chipsnmedia.com; Received: from SL2P216MB1246.KORP216.PROD.OUTLOOK.COM (2603:1096:101:a::9) by PU4P216MB1880.KORP216.PROD.OUTLOOK.COM (2603:1096:301:d9::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.28; Thu, 25 Jul 2024 06:10:52 +0000 Received: from SL2P216MB1246.KORP216.PROD.OUTLOOK.COM ([fe80::9e3d:ee20:8cc7:3c07]) by SL2P216MB1246.KORP216.PROD.OUTLOOK.COM ([fe80::9e3d:ee20:8cc7:3c07%4]) with mapi id 15.20.7784.020; Thu, 25 Jul 2024 06:10:52 +0000 From: Nas Chung <nas.chung@chipsnmedia.com> To: mchehab@kernel.org, hverkuil@xs4all.nl, bryan.odonoghue@linaro.org, linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Nas Chung <nas.chung@chipsnmedia.com>, Michael Tretter <m.tretter@pengutronix.de> Subject: [RESEND v3 1/3] media: uapi: v4l: Change V4L2_TYPE_IS_CAPTURE condition Date: Thu, 25 Jul 2024 15:10:32 +0900 Message-Id: <20240725061034.461-2-nas.chung@chipsnmedia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240725061034.461-1-nas.chung@chipsnmedia.com> References: <20240725061034.461-1-nas.chung@chipsnmedia.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SE2P216CA0009.KORP216.PROD.OUTLOOK.COM (2603:1096:101:117::15) To SL2P216MB1246.KORP216.PROD.OUTLOOK.COM (2603:1096:101:a::9) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: <linux-media.vger.kernel.org> List-Subscribe: <mailto:linux-media+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-media+unsubscribe@vger.kernel.org> MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SL2P216MB1246:EE_|PU4P216MB1880:EE_ X-MS-Office365-Filtering-Correlation-Id: 4518fe44-f213-47ad-2545-08dcac70898b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Micros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YIEGFVpJQBToOlmU3tNlpMjqi7rT5vY/3jsyFVXmQgqml9m4zImeEJHP2ys2u42p4fKaAb9b6b/L0Wv5v/gk3Z3P/KYV8kNJ8hb8KmHrcOL8YxtgdqJigmjjP6onb2keBuvuIaDJdaFefiXZ51qJASpv7ucfgCkUppdrFyUxlI+S7ClCdwJy9XubRW3nlBD5z8REOFkLDcb2RVSxYKdmSlg9ZqhutkszVEdOygsnx6FENub9nMUVqFInWJthQF4zc+TbrWihbt+fRpAR1Ka72HLr33UK6kOauaA6LcV2ImuwW6KkWF8VIDwoUGKUrYsOEdjiJizqT2KHF2c7BdPY/DsTBZwiaBwfxaJZ4ickJYY4+cRHSsbXPrPMyeWldATRs0cqvKPRoVjF4QLHmB0Jp9c+GFMGUuilGtbazkKTe6cAG8NM4A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SL2P216MB1246.KORP216.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: m8XU83G+lO67iXcfjOEXtQHrO4Afe/7isBO38su2so9r8rLXzw3h5aUXgSxmJsDtX2p8uNbpBZawtul/jhfz3NdcVLE0fAwhGQv4uORSHHhzAoKe/oWU6bjzwLN3eEztqNxTektJyKM4Sr2WMEepoIcU1igr7/wWLo4UNkbQxHYqgzHcUZzmzyarKxGgBSndWfTev1xklzHs9LETcQioORKvvtw9uCmQKfD6Y3AmzRypVBKgaMKJlKJ8WS5RbH8WDbX/nETFySTzkMCTgUkTYnuKdP09DTgXU0Pdwgr0LmqlirGtk2+1zAsFLnOo2AcOzIcQUleGR34dV6NVx6JDbrk2+IT9E65axyXKmOn10/NNdjx03VWl5ybEKold/OGh3x9gtFWJ4WL94WG5x2HKyGwJloE0GLhHlBpP/CPOu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bwWwKKh+83K1KHQ+aafY2wqArjVI7j6jqWYHrdaPmFjYf0mEcaxa+ebj1ncB1Fb2O9RJ0+DDS+9l7t3R4XSkIlbOeW8BdwrRx8pRIU3bOOW6FHC4vnKrGksvvEPZgQ== X-OriginatorOrg: chipsnmedia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4518fe44-f213-47ad-2545-08dcac70898b X-MS-Exchange-CrossTenant-AuthSource: SL2P216MB1246.KORP216.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2024 06:10:52.4581 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4d70c8e9-142b-4389-b7f2-fa8a3c68c467 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qhqX1nzy9I5EfYC6yUYDLby7eoSNg33PWMKoo8N/jlgIznV7D/qmNLkJdYPdQLKm54a4Z0SkHMDIeSsUxrg884n4NFFfN5tOONytSfpH1S4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PU4P216MB1880 X-LSpam-Score: -2.6 (--) X-LSpam-Report: No, score=-2.6 required=5.0 tests=ARC_SIGNED=0.001,ARC_VALID=-0.1,BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DMARC_MISSING=0.001,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no |
Series |
Change V4L2_TYPE_IS_CAPTURE condition
|
|
Commit Message
Nas Chung
July 25, 2024, 6:10 a.m. UTC
Explicitly compare a buffer type only with valid buffer types, to avoid matching a buffer type outside of the valid buffer type set. Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de> --- include/uapi/linux/videodev2.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 4e91362da6da..8293b2197ea3 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -153,10 +153,17 @@ enum v4l2_buf_type { V4L2_BUF_TYPE_SDR_OUTPUT = 12, V4L2_BUF_TYPE_META_CAPTURE = 13, V4L2_BUF_TYPE_META_OUTPUT = 14, + /* V4L2_TYPE_IS_VALID and V4L2_TYPE_IS_OUTPUT must + * be updated if a new type is added. + */ /* Deprecated, do not use */ V4L2_BUF_TYPE_PRIVATE = 0x80, }; +#define V4L2_TYPE_IS_VALID(type) \ + ((type) >= V4L2_BUF_TYPE_VIDEO_CAPTURE \ + && (type) <= V4L2_BUF_TYPE_META_OUTPUT) + #define V4L2_TYPE_IS_MULTIPLANAR(type) \ ((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE \ || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) @@ -171,7 +178,8 @@ enum v4l2_buf_type { || (type) == V4L2_BUF_TYPE_SDR_OUTPUT \ || (type) == V4L2_BUF_TYPE_META_OUTPUT) -#define V4L2_TYPE_IS_CAPTURE(type) (!V4L2_TYPE_IS_OUTPUT(type)) +#define V4L2_TYPE_IS_CAPTURE(type) \ + (V4L2_TYPE_IS_VALID(type) && !V4L2_TYPE_IS_OUTPUT(type)) enum v4l2_tuner_type { V4L2_TUNER_RADIO = 1,