Message ID | 20240214-uvc-gadget-cleanup-v1-0-de6d78780459@pengutronix.de |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-64538-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp868308dyb; Tue, 13 Feb 2024 15:28:42 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX0aA7YalubaO+mPJc9IBG95RvSwpoiMWdLBbD4/nC5HfHlTtypcVMnNUuRHrCrmWfCKkscIJzq50HBzfdPvcAqMGsjvw== X-Google-Smtp-Source: AGHT+IHysDKUFG4aWADZSupCI6/2I2AFDzYMXp+nfuhpg5BSaZu8dfp5TGEs3nlWUrcj+HKQwMdh X-Received: by 2002:a25:9088:0:b0:dcb:ca7e:7e6f with SMTP id t8-20020a259088000000b00dcbca7e7e6fmr664611ybl.55.1707866922252; Tue, 13 Feb 2024 15:28:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707866922; cv=pass; d=google.com; s=arc-20160816; b=sde9Z7rX1XXC02ex1V0ksyV2I92a6eY+1BTvjDy2SwXoCKuHnIdxdYOe4Z5BxcosnF /+nsACpCb4NHV4p2H/dwImWy2pnvKepoDUXOFyc0Z9ZliW8GLBKHendTbPHTtQF+nFrH kc+9TNGF4GB/TAjLOVRPrC5XDcJYwEJn6sJfzZyQdzmnSUQNCu5AyDVGwhQ8lSU+fJS4 B7bymBcA2DJrYFWCATsJqVevs1EKeeycl2UfNjYTAnNRmK/7/YCd0CPV25PCfFtx230z gAvBgVve9+1bYRjSHQ8ZefPI6yLrnpZIV+b27aHUH0VxwoTDSuFglgulr0wMc1a43lLc 1ouQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from; bh=jR246WYoCRKX0TLaksqMeLcM70JgkC/SWZGOYyJYaUY=; fh=Tur8UrNFKa4aSXjDaDWkrU+i8phDJzPL4dcTqzxvtvo=; b=dN/3DVQbugcrko1G0DKAXHKsC2jch2XXL6x+GApch8jiTsldqiPF4vwRj1IO0LR7/c kXQZFv3O0v3IHp2EpWNyr95ncdAyNYWZDtfTmH6VhjugS6u5Zene2FqTvBJ5A/xB+XMg HGRYbsFJiqKYiU4LNofqMi2kW/gwczIovYVgCIWTqwigaQE23ZFWsOw4vx/h+zTHjLZZ kOUZv5SIdOuSGXlms2c1FGdAIecLLMiLxhGChYnXC/f2+75B7suNi6VhMTiz0KzlC02n 5vQaPJzl7xcMFg4I46lgEwVlttYEuZUb/cUDcBxc4AV0tqLzWZgYWjeDGcQW90QbD6sh qPvQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-64538-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64538-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCWXIzt4zT4yvFEOi4cB03O973ZvsxMZ6ATA3o1DUERavF7fpM5yMHvLdgoeYVPet2xOx5lMqBSnm1wALFZXH/CzMnY5gA== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d15-20020ac851cf000000b0042c6b556eb6si3770946qtn.50.2024.02.13.15.28.42 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 15:28:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64538-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-64538-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64538-ouuuleilei=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 100561C27BE5 for <ouuuleilei@gmail.com>; Tue, 13 Feb 2024 23:28:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E4C9F633F0; Tue, 13 Feb 2024 23:28:25 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 EDA1863105 for <linux-kernel@vger.kernel.org>; Tue, 13 Feb 2024 23:28:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707866904; cv=none; b=o05TU0dOSRZqev+S/g4uYpWVa+3idUl+6qdVqcKvxZRQgRbQgjWC/ULWQPvl2qiVCYhnt8PJihquq/8GnQCoDohSfKoILi68afxqukRBDrR8vqLegHTHCwCtfXaAVvLUivUbBcmvfhC+9v8TvwrmVRTClul/ssbMbQ9mQ/icIfk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707866904; c=relaxed/simple; bh=2XHPW0IeDzyoUhCFA+2qg9dfudNUT0CpxgadG/4rkZE=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=DCOq2Y1ND0oQWq8bYXaKGAF/YL2CT0PYy+w+7210nBRyZih+qLpNPFX+nPaMQcUITi67umfrH0e4ZqfrJRg6LFvj6iJZB/7Rd3Nui4dq9++sk3xlWkcl8zOLCGE7xHPk+UjfZf0mYRbxbyoQimtnVCtKm3iipaNIjxSi9CaI4gk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <m.grzeschik@pengutronix.de>) id 1ra2CI-0000eS-Ig; Wed, 14 Feb 2024 00:28:18 +0100 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <m.grzeschik@pengutronix.de>) id 1ra2CH-000Zcn-UO; Wed, 14 Feb 2024 00:28:17 +0100 Received: from localhost ([::1] helo=dude04.red.stw.pengutronix.de) by dude04.red.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from <m.grzeschik@pengutronix.de>) id 1ra2CH-002uYW-2r; Wed, 14 Feb 2024 00:28:17 +0100 From: Michael Grzeschik <m.grzeschik@pengutronix.de> Subject: [PATCH 0/3] usb: gadget: uvc: refactor and cleanup the pump and complete handlers Date: Wed, 14 Feb 2024 00:27:59 +0100 Message-Id: <20240214-uvc-gadget-cleanup-v1-0-de6d78780459@pengutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAP/6y2UC/x2N0QqDMAwAf0XyvICWbpP9ythDjLEGSibtKgPx3 xf2eAfHHVClqFR4dAcU2bXq2xyGSwe8kiVBnZ0h9CH2YYjYdsZEc5IPchaytqGMcYzL7X7lQOD hRFVwKmS8emotZ5dbkUW//9PzdZ4/cKxtsnkAAAA= To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Daniel Scally <dan.scally@ideasonboard.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Grzeschik <m.grzeschik@pengutronix.de> X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=793; i=m.grzeschik@pengutronix.de; h=from:subject:message-id; bh=2XHPW0IeDzyoUhCFA+2qg9dfudNUT0CpxgadG/4rkZE=; b=owEBbQKS/ZANAwAKAb9pWET5cfSrAcsmYgBly/sN+xx0LGEW9HGwwH094+bPtpfsSrcdxPADI 795T6oH9w2JAjMEAAEKAB0WIQQV2+2Fpbqd6fvv0Gi/aVhE+XH0qwUCZcv7DQAKCRC/aVhE+XH0 qzdzD/4s8xWWvujBAqeGrs9leLb+3uZe+etQd8yJMCCikhv8XmiUNzOBDeC5LaHaz6iGyo/Fbby uvtg+d8tW20/liJVKihR3BCs+WszQ3Z6YNc4pDoDXIEjXt5F0isDWl+J5e40D5QsdgHTQyN/ALv xHg26SyIDBz8bf4AMjYlQqrAFeY23gbzcWCNm3zDQyY4BM2SEea1OGWwSZab6bZLFoYC0/65yHh CYg2/7RJTsO3vt+OpEvwAL+rCLYDNuiBv9IQ2ID0zRVzozmUtPr2YV+1vAPNt6v1zJhSpKlAjRj nDqlJdMT3weks9wooTxok2UhcGqX9dMt9Y7yev+g7U3L0A/bXeOLk4NrLCZ9e442oiEE0ZmzPFD 3PS8L/e45mSBkoKkxeVJ3jTK0mlb+w1gHrZZOTkXYq8mpFvSMlFc0+LxLXBCUsEpY6xgjhwF6oD FSx6iyUw5fJ4D6ocjgk1KLKZjujAYDjD+uo7x4Z975qVMBGNGavwtk70i8IPhoW/vW4j0SnGjpk 4P9l+4H5XLTHxH9QJ1QQYwualyPwRFR+hR+5VEYMSuDIeSRr85LNNk+2EKOJqgn4L7P07s2K9ag bJLNBxsy8LEoSwfZCcfEAFci9yjivrY8lmXbVzqnpPP3C3WsmbZz5FX0oq862+3mwZkfLoYwUwO B72wUYnJNDp1CYQ== X-Developer-Key: i=m.grzeschik@pengutronix.de; a=openpgp; fpr=957BC452CE953D7EA60CF4FC0BE9E3157A1E2C64 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: m.grzeschik@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790828265672889468 X-GMAIL-MSGID: 1790828265672889468 |
Series |
usb: gadget: uvc: refactor and cleanup the pump and complete handlers
|
|
Message
Michael Grzeschik
Feb. 13, 2024, 11:27 p.m. UTC
This series is cleaning the complete and pump handler to improve
the code quality. It got really hard to follow the locking and escape
cases since the recently introduced patches.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
Michael Grzeschik (3):
usb: gadget: uvc: drop unnecessary check for always set req
usb: gadget: uvc: refactor the check for a valid buffer in the pump worker
usb: gadget: uvc: rework complete handler
drivers/usb/gadget/function/uvc_video.c | 109 +++++++++++++++-----------------
1 file changed, 51 insertions(+), 58 deletions(-)
---
base-commit: 88bae831f3810e02c9c951233c7ee662aa13dc2c
change-id: 20240214-uvc-gadget-cleanup-e8484f675c2a
Best regards,