From patchwork Mon Apr 15 19:34:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13630599 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 146F2C4345F for ; Mon, 15 Apr 2024 19:37:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vX1PwagOqddGZ6+QT7PkARliRmXIqvA5eDaztt1pw+U=; b=HbX8XVlWy+PMug 2VHwRbFpg09HgZ7PtGK4obkRg2BKjfHF5hq2X19AnNDHyk2BoS+uqFa1tQrkwzuyXpWC1YR7z+nn9 s6cit3bKAMP2HqEMiDdyOa7FLNoXC+GD3oRR+kQv9F/hOv/H2Pjgkdcnn0EM0l+JRO/WtI7rl/W0e Br9N49pj5RP1/kk3zGihFMNHQNThp5v0ZISMXJ3U3ntQnRS1qpfEzV8VD5EWkP4/Yq6P0SKnd0Roi novK32zWad6SqLdZdKXsSgjSJVe07xlnukBmf+lO3uBjJzSYVjnW+vBJGdenyUOeva7Xx4kZknEKJ Qvo2mdoYLVts9GxGXZ1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS8N-00000009dNP-11M3; Mon, 15 Apr 2024 19:36:55 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6P-00000009c8G-3VvJ for linux-arm-kernel@bombadil.infradead.org; Mon, 15 Apr 2024 19:34:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=bek9HrODBg0M3bgnVqO/LKhPssOu/ibs61pEEfKBgdM=; b=QqRf+GvMV5o2FDE7rJBZusTmsL r3GbDHslzoKp3YyhfODvq57MSVSP8P3JQv3sCbK36rts6aKhU18NRcTWq9tL01WyEQ3x2QR3GoTiQ ug4jipYblsnyCqDyYWialHnqJOmEDWP53N+iqUASJlyeZ8qGAZ/vExP64fnzrywzI5z1E5gvVdHss 2b3hKaKgoLrzrb6WN8vVUIfNuTZpO0RhUbVnSkzmFiDzEGTrpAK7rW8p2AV6QpJdNRqeSiG+Tqo8f UpvF/O6MbCKYTzh8zpJrOQevnHrgSxgLGK1JAhQ8GntM/Au2Pmisfm3ZgYd7SO98v4nF2h4qQq3+T VOnl2rIw==; Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6D-0000000AigD-0QX8 for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:34:51 +0000 Received: by mail-qk1-x72f.google.com with SMTP id af79cd13be357-78d57bd5781so264753985a.3 for ; Mon, 15 Apr 2024 12:34:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209677; x=1713814477; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=bek9HrODBg0M3bgnVqO/LKhPssOu/ibs61pEEfKBgdM=; b=lGIpfzBEEmX0MSiI/rwwrSvMa2ZRGrJvY9m5EMXq4NMMDR79x7U0GX0C+jBjbHTCXE Ee/CC4ptBEaFBVZLE3ND1AEctXSBueNFVeJqPk8Y7cuC9reXZoP9m+lcNi86GZ0djqp+ cibEgreOlVuglIvVWKlnbpCPcqrHNY4jHua7Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209677; x=1713814477; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bek9HrODBg0M3bgnVqO/LKhPssOu/ibs61pEEfKBgdM=; b=we7FuLBU9oyPn7GHwvyhWtxV5Y68kPNh3PN5r9xbOT7AZdbgebijYmBNdgGFRRRDDB p0exe/jRybpEGp/1KfhNcTIDZCYNcT/2bqcor8jk9OxlY9+3NTQ2gXNsvLkWtqxHwUYu 5J/nPR/mj6nZydivAUkUHXN9ufx9YC6J4U+xCGJr01QwpICMcemKR/y9xsFJT6YpMmZG I6MD/euUUVKGueJ3eKpNN1oDqYKMe9vsa98fv8FKU4QTXhwUEkTgR/DYwEZaM4lI8E/n 9IDTHWJuH8wpnRGlvDPO6So9ITu2BrrX3fmP2cY4kWySI8gvtLhUSPlFEwiNSsL8ESmz UyBw== X-Forwarded-Encrypted: i=1; AJvYcCVyxmgBRI9REao2RcZatC6a3lmtUrLTTALcxNUXsbTuE1mjoZXrUWiCRweumxYCcgR2N+IDe4J3dSjmJzJTlXhsYsUhOTJfieYpyP2e0owvo50ECYE= X-Gm-Message-State: AOJu0YziOdzOQ+AexW6gcXZm3NDibhKpPevx0YD3oDQZuaXNCV1daW0+ UTnno3GdkBmfB0HStDuV/BuaL9mT/cRRZH48J5cEv/JVLwSH0mGihD2rujD00A== X-Google-Smtp-Source: AGHT+IGdkApYbK4mkbCfGsE7agdP/ocKeSLQEP1wZl23ZOICtEnIFWB9MCiZP2rFcKrIOjZRFtHqpA== X-Received: by 2002:a05:620a:611a:b0:78e:e035:e898 with SMTP id oq26-20020a05620a611a00b0078ee035e898mr4919595qkn.75.1713209676753; Mon, 15 Apr 2024 12:34:36 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id s26-20020ae9f71a000000b0078d3b54eb76sm6718055qkg.78.2024.04.15.12.34.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:36 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 15 Apr 2024 19:34:26 +0000 Subject: [PATCH 09/35] media: v4l: async: refactor v4l2_async_create_ancillary_links MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-9-477afb23728b@chromium.org> References: <20240415-fix-cocci-v1-0-477afb23728b@chromium.org> In-Reply-To: <20240415-fix-cocci-v1-0-477afb23728b@chromium.org> To: 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 , =?utf-8?q?Ni?= =?utf-8?q?klas_S=C3=B6derlund?= , Pavel Machek Cc: 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, Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_203445_740017_EC1346E8 X-CRM114-Status: GOOD ( 13.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Return 0 without checking IS_ERR or PTR_ERR if CONFIG_MEDIA_CONTROLLER is not enabled. This makes cocci happier: drivers/media/v4l2-core/v4l2-async.c:331:23-30: ERROR: PTR_ERR applied after initialization to constant on line 319 Signed-off-by: Ricardo Ribalda --- drivers/media/v4l2-core/v4l2-async.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c index 4bb073587817..e26a011c89c4 100644 --- a/drivers/media/v4l2-core/v4l2-async.c +++ b/drivers/media/v4l2-core/v4l2-async.c @@ -316,9 +316,8 @@ v4l2_async_nf_try_all_subdevs(struct v4l2_async_notifier *notifier); static int v4l2_async_create_ancillary_links(struct v4l2_async_notifier *n, struct v4l2_subdev *sd) { - struct media_link *link = NULL; - #if IS_ENABLED(CONFIG_MEDIA_CONTROLLER) + struct media_link *link; if (sd->entity.function != MEDIA_ENT_F_LENS && sd->entity.function != MEDIA_ENT_F_FLASH) @@ -326,9 +325,10 @@ static int v4l2_async_create_ancillary_links(struct v4l2_async_notifier *n, link = media_create_ancillary_link(&n->sd->entity, &sd->entity); -#endif - return IS_ERR(link) ? PTR_ERR(link) : 0; +#else + return 0; +#endif } static int v4l2_async_match_notify(struct v4l2_async_notifier *notifier,