Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1887342lqp; Tue, 16 Apr 2024 00:05:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCURR6vgzVfoJapbHkN5OAHbGaJJkv6Ty2k4pKsrUS3Av4QTlP/qPF6ob1dsLrO3U7+vBGegdaWTS7EwWh1QvWtQq9RYmoSRlE/OOzm8Kw== X-Google-Smtp-Source: AGHT+IGKgPuyn6gSeuFKxL7DDyhnbhM4VQuXPHw+ge9ANgm+RGFQ0pkhIQs1XARDW+ZoFkaKch6u X-Received: by 2002:a50:a6dc:0:b0:570:332:aad3 with SMTP id f28-20020a50a6dc000000b005700332aad3mr9324892edc.39.1713251157593; Tue, 16 Apr 2024 00:05:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713251157; cv=pass; d=google.com; s=arc-20160816; b=wFzdT1Rp6uAA1syrrG12/hPcyba3ajDy+3Uh0FREab44DRoO0IVmogMi3aY446bVrd jxDlttJcrY9Ktj86xS4xcbwP/Mc1HMCggd9wCjcnwGh7cqFN85oH2Wq0O2g/wvTCTyYG p0IQJGMmA4jC/yp+sh6tTZY4//AfxLK6xPrTvoxmH9sYnC7XKlsCc1MM0TQuYE08wnLA nSKX47SeoXkNl9tDqsAIi4otmxAvMNXbJ8BZU3Sz/lQ/vXfDLGuxZ59QfOTG9SCNZJ48 50Z4kY44L0Y8BO6B0apY5R78Q+49AXH2txhJQrryV6mVnRT109DEGTMi2fVOM2O7IBXN Puyw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:in-reply-to:from :content-language:subject:references:cc:to:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=11Y55v0AlzuRPO7ifOFiCZQ7lrJESQhpZwvX7xtpFpc=; fh=I8a5bE/pwCvA7KYvdIKrPXrCKFc6PYTvhe3MfMC0W2Q=; b=rnvysJIWXOOzd2i6oc1TO8D5S41hW8kB65qdydCj8lpwiLFlkB8NNMthmkUrsbRvn6 g/afo8Sn23la/MCRaBp+tst2ZegTJGCNk7MApKeL1mpeeT6juEJNEmIhchzfipMeaNKO 7XnEeFf0D2zo/MFb4IyW2E+vtwnDdPIHM+E9ZAVisIlX7KF3RR8MyUI8eHS9Re6EYTg4 DQsaMY2oeyv2JGq7SUjUK4wkJKvzuH6Z7HjHGk7flSXMJsIOp6ZT74bG9V/Kgw7BYn+R ZTcmYCb+KSH7opiqwJeSieR/eIpwaP5KZm9UjsbL7w1j6/obx/kRCEZ0VGyi1vu5s+YO oT2g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=uYYpoJTm; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-146380-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146380-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id s28-20020a50ab1c000000b0056e698939e1si5152760edc.548.2024.04.16.00.05.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 00:05:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146380-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=uYYpoJTm; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-146380-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146380-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 55BCA1F22819 for ; Tue, 16 Apr 2024 07:05:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 400A084DF0; Tue, 16 Apr 2024 07:05:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="uYYpoJTm" Received: from mout.web.de (mout.web.de [212.227.15.4]) (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 9A2D07EEFD; Tue, 16 Apr 2024 07:05:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713251132; cv=none; b=Q8sEBSDiF6dCWwnkxz8z6t7SEq9F2oeYmA++DsD9TpbaVCp5qtfq3Cr46FLf9Gk5oj3Okf3rUiG1hIuJMl9SbuwrjwOmBXwcHlvMF4J7uf8awNAdBSuXvCdQHZx3uN6diTpd6QYS8ljuqJEK0qslwgpu/WGTB0fT+90mgua7r8Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713251132; c=relaxed/simple; bh=fpIr7vk9ma0F1Ajyvw7T8mvDHmQiafMnVUv8cVES/Q8=; h=Message-ID:Date:MIME-Version:To:Cc:References:Subject:From: In-Reply-To:Content-Type; b=pbkEDZxhkZLvYoVyF910qvs5e34ZpDev5m6tO4WEyRpE99ImAQMo4mt3vfmbrn1oSv4t9QDWcKQApg2pxyn408c1PDGEqzR/zxC5SujK2CGlch7uwhFETBC7RddPugDRdvp3YYRON8Gs7RaYJ1u4SjQgDozAOjoqr02+2SU+p+Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de; spf=pass smtp.mailfrom=web.de; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b=uYYpoJTm; arc=none smtp.client-ip=212.227.15.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1713251047; x=1713855847; i=markus.elfring@web.de; bh=11Y55v0AlzuRPO7ifOFiCZQ7lrJESQhpZwvX7xtpFpc=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:To:Cc:References: Subject:From:In-Reply-To:Content-Type:Content-Transfer-Encoding: cc:content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=uYYpoJTmRqgk2fHBG3KnNz2CLPavpRrEfJtq6/fkxsSHPHo9hr9qcnbetfR4rbAv WWYYcMCU5QC3KoHYZsERO/uCRV2oxChX6X+Rafq4yYRbQohsxFKvostPltnlOgZUZ uF9kX12zxQQdi44vnDxMP2KDpxbIBaLpo5hqzClbmR4INeL93ovd+wCPNkORolTKA RsWEq1pb7kj6jurgWDs/BjuRAGZTklJtZ686dqKAidxv8QQmS4EmEZg2pw3cisyw+ IuhR26xDJ4uJ6w3UN1gJ6I/LtVomRg8m99Raf/c0Fc4QVAeD0lf4ST2m6UyLR9hF4 nOhZqEsl8lmkPGi/9Q== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1Mvspv-1smFwO1js7-010uHt; Tue, 16 Apr 2024 09:04:07 +0200 Message-ID: Date: Tue, 16 Apr 2024 09:03:36 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Ricardo Ribalda , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org, Abylay Ospan , Alain Volmat , Alexandre Torgue , Angelo Gioacchino Del Regno , Benjamin Mugnier , Bjorn Andersson , Bryan O'Donoghue , Chen-Yu Tsai , Dmitry Osipenko , Ezequiel Garcia , Greg Kroah-Hartman , Hans Verkuil , Hugues Fruchet , Jacopo Mondi , Jernej Skrabec , Jonathan Hunter , Kieran Bingham , Konrad Dybcio , Laurent Pinchart , Luca Ceresoli , Martin Tuma , Matthias Brugger , Mauro Carvalho Chehab , Maxime Coquelin , =?UTF-8?Q?Niklas_S=C3=B6derlund?= , Paul Kocialkowski , Pavel Machek , Sakari Ailus , Samuel Holland , Sergey Kozlov , Sergey Senozhatsky , Sowjanya Komatineni , Stanimir Varbanov , Sylvain Petinot , Thierry Reding , Vikash Garodia Cc: LKML , 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 References: <20240415-fix-cocci-v1-3-477afb23728b@chromium.org> Subject: Re: [PATCH 03/35] media: uvcvideo: Refactor iterators Content-Language: en-GB From: Markus Elfring In-Reply-To: <20240415-fix-cocci-v1-3-477afb23728b@chromium.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:sHR+TeGSFgoxPZvFUHAPIEuDVzgT2GvvVwRx2R0bQhoUCLrY21q 4aVwGDwLU20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HSLrk= I would find a hint for a variable change more appropriate in the patch su= bject instead of the word =E2=80=9Citerators=E2=80=9D. =E2=80=A6 > +++ b/drivers/media/usb/uvc/uvc_ctrl.c =E2=80=A6 > @@ -2175,16 +2177,16 @@ int uvc_xu_ctrl_query(struct uvc_video_chain *ch= ain, > int ret; > > /* Find the extension unit. */ =E2=80=A6 > + entity =3D NULL; > + list_for_each_entry(iter, &chain->entities, chain) { =E2=80=A6 I suggest to move this assignment into the definition for the affected loc= al variable. By the way: I see another source code adjustment opportunity in this function implemen= tation. https://elixir.bootlin.com/linux/v6.9-rc4/source/drivers/media/usb/uvc/uvc= _ctrl.c#L2165 Can it be nicer to use labels =E2=80=9Cfree_data=E2=80=9D and =E2=80=9Cunl= ock=E2=80=9D (instead of =E2=80=9Cdone=E2=80=9D)? How do you think about to increase the application of scope-based resource= management here? Regards, Markus