Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1650673lqp; Mon, 15 Apr 2024 12:38:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXQvwzyMND1ZPHus9xkPcgwWGUXF3RfbauDk2VTvyDKNChy7GYtPXVk7h7pTwDc59wu5rCbEwIC/ykQONRX/Tb2PRFa59awDcCDFsLivw== X-Google-Smtp-Source: AGHT+IEdanaCsbViensURyeWKhFdgebMcvT25skceZkI7JWBDwh4asKUiGPwzfbnuBNsRiHBOiyc X-Received: by 2002:a17:90a:f2c4:b0:2a5:395e:8673 with SMTP id gt4-20020a17090af2c400b002a5395e8673mr9010097pjb.5.1713209916123; Mon, 15 Apr 2024 12:38:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713209916; cv=pass; d=google.com; s=arc-20160816; b=Yhp290hROG8xrd4fMpT4WK9Z5ShuH3ih+UemqWsCr+WtqWHO3yWvAs9llEY+BNcz4k Z3z55uceTI4LLdVXFSf5V9V9AtQXewyYeoyCBDrCzhzfG9REdcRu87kDyNj0etVgZEHD VBtCG5vu6DD+kC5Iqce8kaj2w68h+nU9waaTLX/qPHNViDqSXHmMOtMzjED8bt6R4NI3 C2uyVyDEdUS1XKLFqCryno5UdQuXcOIdV+c2WdYRiXRFrtQRAVwgkQgst+JcSKwJD6r9 crAXCAbOS73m0JhVbAJxw6KDc7qt2hJ1o1M/oOmv8gT+Cf9I2gD/4lKx/ZUEYiIK1/7C rnDg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=bek9HrODBg0M3bgnVqO/LKhPssOu/ibs61pEEfKBgdM=; fh=p93n4ZWZsgsSFR5sZ/7whlUtHJn6BvdEbxvtIrPi00Q=; b=xWIvfYmoFetlu2KSZYGsBp9thEeKENnX5LFSt0l2h8KGoxoVALSbn+/tgQ7YDWiSwn L6gEriX/BSN0YYddk/4jmnulIpRfaHQZHPypl4yKPsdGEjFXy08jC2FUcApfZHzX4dL5 pJgv4+ucTKAvcg/qqzOk35IpAQ+fit+VLii0RxCBBXGVo3kkDauE6VGR68nrS5P6TV/s 0urVXRt46NKdtNOKQ0hIP6BIiXSFGymTqWP/vsgs3R+Ni2xLKKQm9LPVII6/dcRYyENc WgscBRK70BWaMSy7RNA1uhBon8fGkzTwGUGWW2duK8hA2jA4F7+0FVPsNK1Ej0LDh6/T T1vg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lAJYAyUx; 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-145791-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145791-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. [139.178.88.99]) by mx.google.com with ESMTPS id q12-20020a17090a2dcc00b002a609d46f35si9135070pjm.185.2024.04.15.12.38.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:38:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145791-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lAJYAyUx; 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-145791-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145791-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 C29B9280FD8 for ; Mon, 15 Apr 2024 19:38:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A4EA415B56D; Mon, 15 Apr 2024 19:34:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="lAJYAyUx" Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (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 B14FF159912 for ; Mon, 15 Apr 2024 19:34:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209679; cv=none; b=tiYdzgiGDT8U1mitGLwQI5rM+zfdjYvtcZai1wsYgTSIvkkfpG0XxfExVBqet8MOZkn90HWheSStxUD3VVKzkyCAjDDNZiR0sa8KPwwAfdgLXUOKKo2IMwUlv9ceGeK0WZl+AWn4CP34IUruZaoJVVhtH4GgP0iCp+mwKd3YcdM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713209679; c=relaxed/simple; bh=NnOHj16PJj1bni+SNvuNVuvXN63e8NKQOBdaXLcKwbs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cLhkm70NEnXJgc205Pc/+t2ZxOHoAP8KzomoAx92eIBZMLt1KnUMPXkiN7Ey5aqQ7nBZBIIVz54QfxRInXPLQVkRmbitmPuurMffv6g3wo7lWf8nin5bIdddMsXTmFwFNuC9Q/f0U6JPhOgVwziGMxQzjBZPb56hlRVKE98DIWM= 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=lAJYAyUx; arc=none smtp.client-ip=209.85.222.180 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-qk1-f180.google.com with SMTP id af79cd13be357-78d57bd5781so264754185a.3 for ; Mon, 15 Apr 2024 12:34:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209677; x=1713814477; darn=vger.kernel.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=lAJYAyUxo5riS0FArLbetp4a3tYm8T9UHi0nYdQ/AR5gr+vCiLxqT5bS7dJVJIemeV lsZD9YWhn7+XN6Pe9FBG0a74dcIAQLXuyBb6OL1Fiy7RK7zEKtD7OWYoQ6C7GmyAx+P7 suqS5lmIC46JseRrYQS+4OVk9CDmVXKDHzKVE= 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=AUxm5DiI8AwrjrS+2mbDucsO9H+f3fX6CzJe2/WtPb6beOKpwk7ewn35n4cZxgbTrf NV/Tcc6JkNdiJEfyufXVo7UCic9vApmN+AN0ySR48TdbbCUg73RMyH241JHrqEDi2dEW oa0TXmumofvj/YzEftmQKB+O/gjtb+U5wYwpNjBVC+fPTElOUDUKCwnjAW0m5YCvSEK/ YXYCmvEu/BeTVDYGIoAxHVEB4KFIQ2lHP+W2vY72Iyms7+8UdOxA5cn5DBvNCMBv9Uo2 FgzgmhyOxpc80EYZsxQJoc31uL73QsZ/WRkiWElWAT84xZVZQy7HCN+cY58sNyVKXT6m I6Zg== X-Forwarded-Encrypted: i=1; AJvYcCVhpDpdUJSCF5QkoljmPaAXQcKLrBH9sbkcvllPNLuTT2dovQ3IVcAS1VD/5kEBq6sYXR2gu/GvHJkNHfcrd/gC290DjkC2RgQfOUpo X-Gm-Message-State: AOJu0YzC4Phe5Il2eowpOla/0ZgtJv5r94cxFufNIJiAQMCZmIvL9am1 7TIEdmo21uzHM54neAUINll4VJuMiva2x/h6l11tHb+3x9a4sBeJ5OqqJFBVyw== 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 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="utf-8" Content-Transfer-Encoding: 7bit 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?Niklas_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 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, -- 2.44.0.683.g7961c838ac-goog