Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1840608lqp; Mon, 15 Apr 2024 21:39:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXFcnEg8pnJmHaUC1PH2MEjisEaQ6ghmNi6L4wxsW/8yLDZW2tqYlY1Jdd/SotgiRuVqmlLSnVctPnNyuLy560+8Tg20iqzOhwH7oqHow== X-Google-Smtp-Source: AGHT+IGdVVyhVNUtwxx9cSTbQV5IVQGwf0f9iaYmoWQspeEk5miDY0QDA0HU2b5FKOhjN5bgw4uR X-Received: by 2002:a05:6a00:2387:b0:6ea:df6a:39e7 with SMTP id f7-20020a056a00238700b006eadf6a39e7mr13515330pfc.13.1713242391195; Mon, 15 Apr 2024 21:39:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713242391; cv=pass; d=google.com; s=arc-20160816; b=PFjOJyd6tODLhFIkdp8Ix1G++8Wrrkw2Sj4SUdSjhYesm9g6JsPTDWaG36+Qravwfv A+ZwqCq/AgSwdJQ0eK+UC6rGkW+AbtVJJB8WumAFqr4mUh/z1OctJSeV6jMwAjDO4N4B YPJ6uhsZp7Kp63HXfLMDw3dvtopBxtsFLBiTjr5OEt+DCGs76jSaU2HilZGVaIqk/ErP TdqzXwHkNjtXruHeQBXf9tzIAuHA8oY+kqFFTdAOosGKChGBf6MkpzHDBvjJLjbgW6zO wLbmYmtNLXN664VJ1tyW100oP0ZMg6cxKe5H7XWnFBnWQMYNgbkRIb0gWiF1zGezeWOy 4yGA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=VSyiMdTHrk1JwFRWNfMWMCAnJIqFPtjB/dNBg4kU2zU=; fh=4Ncqq7m5CIu1vLuspL4pZg36owhn2rxO6ZAKnN8DIho=; b=X7tb5QBzbwhEJxu0oqxl8YgrNpIx8vokC6TS7vmUUPR1xk3b9NL/untJLmndUoWQLS pnS6PbgNbJo9fl3DcRX8lb/A3zfdWCeAMEiu/03ej815djPGltIvj8eKOet/mG7HdqSf AfofPmiWKJ9ErSSgGEzOs7F8NpE+IsjDygUEKto8M+bIZ6D60tQCOWQmvUtks5Anc1EB Fpn7CsniwV0TL0rM/bPXjpuYn0Jndoeb+P7VdAku0DO36IcSzeM0u3wOaH5+OyuCGvMC KGiuX7ZBbDjtfAwCnx7hEnZyhtzdaaCIlTyafM06wqbGdWH16M3xhxRVgE8Xli0ALjV5 HiUw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=cuePyVKv; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-146233-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146233-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 76-20020a63024f000000b005dc50605acfsi9044417pgc.519.2024.04.15.21.39.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 21:39:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146233-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=cuePyVKv; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-146233-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146233-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D2F65284C9A for ; Tue, 16 Apr 2024 04:39:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9C4AF39863; Tue, 16 Apr 2024 04:39:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="cuePyVKv" Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0E0D39FCF for ; Tue, 16 Apr 2024 04:39:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713242370; cv=none; b=HsiKcn0mtAeU0hA15slnxmW/d4NXZW+9GCB3xyl+aORG4a1eqWUgeXToXwrYXax5RvpW4iSCGPMjsjddd/1WKBoPVmTfptvSUVUYIMc/BGuTGVUfutPKlC/MY8aFZkWQbSLgzVowCuJqM6ZFHKSddxwebmptrLZ74G0sozS9uaA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713242370; c=relaxed/simple; bh=5PbOnqT31q7bJvtyCBHwTsPiD0wb0iv6/vtz4oxAlr0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ms9PgHgU6vK2Xi5kfy/jPPqOC+rhR8n+gAqs7sj9rAXvdxj2WaCvEpd9zmdwOP5VWfEi7KBQ5D9lA+bLuHXnPqVdWwrZuYumKd7vnHkQ4edjHxvmFUybWQ3eaCWBiFERKOAdUSAZuMoQDoQtx81mGy+HUynODRAy1lRuXOsM+8g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=cuePyVKv; arc=none smtp.client-ip=209.85.210.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-6eb86aeeb2cso699913a34.3 for ; Mon, 15 Apr 2024 21:39:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713242367; x=1713847167; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=VSyiMdTHrk1JwFRWNfMWMCAnJIqFPtjB/dNBg4kU2zU=; b=cuePyVKv3DGJ/nFLG5QvC8sL/8WdTgU3tN86JAmS+BbM6GTJL+xezvrAsWBOz/FuQd 0GBe+QYEyRgxZldi4iMrKxhsB8TBfrKP+3JkeOAErxyDJh0nfEMwq06aW8R6V2klvRgb Ro3PkrUva+VL5EFN6RRyVcCyCZxWLx1jnYW3w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713242367; x=1713847167; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=VSyiMdTHrk1JwFRWNfMWMCAnJIqFPtjB/dNBg4kU2zU=; b=C/WEe076GjuEqG0qN9tDFp/CgFgccWD2ZmHQBgCC66JnPN6wHqImWFumhOH+DqEhgN 27azMgVQS7cNPMXZdb/hyvvTRxaG/CPQkSDdHbjHDT2TSf3oQO/IFL8CXmAKZmDPDkLZ RuVHmc5h9emX5jXn2ReGhwTgjumkgNHtmNjkBScZQzqw+x4CzI88AY2PS6U3RdgxDqfY Ll4PMmETVw82FMLfrAfFhZtjyXrf8QS4YPMBQX/kYf7md7nb52d4sFdDMtd+E/0Fmv3E a+BsD10T1jBe4JxEjyGgPNktiCWjqzpX0QXTcs4TgqgkCavSrr6NRYpG06U16IpAVXQo ljww== X-Forwarded-Encrypted: i=1; AJvYcCUPbizoAz5JN3auSu8YGVnrWM+ObNGHfxJf+KQWuAq/lZ3rXhuaymq6IPv9DoD2hQGbkw+7F5FVLbXGYTwCR3sGkTyiw8DOx9XpQ3BE X-Gm-Message-State: AOJu0YyCuJEUx3c7/cakH251I0omjiPB6D68uGFH46kwcGYL2FtOZwKS LamQIHinh8Xah93pUctRGW5kVubPhgLbeR+rGIuwH3Y3qXKmu+wpfrn2XZSwIw== X-Received: by 2002:a9d:7f8a:0:b0:6ea:23af:2bcb with SMTP id t10-20020a9d7f8a000000b006ea23af2bcbmr12688528otp.32.1713242366850; Mon, 15 Apr 2024 21:39:26 -0700 (PDT) Received: from google.com ([2401:fa00:8f:203:1137:d3d7:a09d:5379]) by smtp.gmail.com with ESMTPSA id b65-20020a633444000000b005dccf48e2a5sm7898637pga.54.2024.04.15.21.39.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 21:39:26 -0700 (PDT) Date: Tue, 16 Apr 2024 13:39:16 +0900 From: Sergey Senozhatsky To: Ricardo Ribalda Cc: Martin Tuma , Mauro Carvalho Chehab , Laurent Pinchart , Hans Verkuil , Hugues Fruchet , Alain Volmat , Maxime Coquelin , Alexandre Torgue , Paul Kocialkowski , Greg Kroah-Hartman , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Sakari Ailus , Thierry Reding , Jonathan Hunter , Sowjanya Komatineni , Luca Ceresoli , Matthias Brugger , AngeloGioacchino Del Regno , Hans Verkuil , Sergey Kozlov , Abylay Ospan , Ezequiel Garcia , Dmitry Osipenko , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio , Benjamin Mugnier , Sylvain Petinot , Jacopo Mondi , Kieran Bingham , Laurent Pinchart , Niklas =?iso-8859-1?Q?S=F6derlund?= , Pavel Machek , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH 03/35] media: uvcvideo: Refactor iterators Message-ID: <20240416043916.GA14947@google.com> References: <20240415-fix-cocci-v1-0-477afb23728b@chromium.org> <20240415-fix-cocci-v1-3-477afb23728b@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240415-fix-cocci-v1-3-477afb23728b@chromium.org> On (24/04/15 19:34), Ricardo Ribalda wrote: [..] > @@ -2165,7 +2167,7 @@ static int uvc_ctrl_init_xu_ctrl(struct uvc_device *dev, > int uvc_xu_ctrl_query(struct uvc_video_chain *chain, > struct uvc_xu_control_query *xqry) > { > - struct uvc_entity *entity; > + struct uvc_entity *entity, *iter; > struct uvc_control *ctrl; > unsigned int i; > bool found; Is `found` still used? > @@ -2175,16 +2177,16 @@ int uvc_xu_ctrl_query(struct uvc_video_chain *chain, > int ret; > > /* Find the extension unit. */ > - found = false; > - list_for_each_entry(entity, &chain->entities, chain) { > - if (UVC_ENTITY_TYPE(entity) == UVC_VC_EXTENSION_UNIT && > - entity->id == xqry->unit) { > - found = true; > + entity = NULL; > + list_for_each_entry(iter, &chain->entities, chain) { > + if (UVC_ENTITY_TYPE(iter) == UVC_VC_EXTENSION_UNIT && > + iter->id == xqry->unit) { > + entity = iter; > break; > } > } > > - if (!found) { > + if (!entity) { > uvc_dbg(chain->dev, CONTROL, "Extension unit %u not found\n", > xqry->unit); > return -ENOENT;