Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp520959lqt; Fri, 19 Apr 2024 02:53:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWsdJQJwlNYsf+TPvajRS6bvkF3JlMzkv7JrMLBwITevMjOrttLskqmZY2M442IHqrTV/f4XlH5FN3ci+ydJ7nvF3Uh47i86VKr7N2jxQ== X-Google-Smtp-Source: AGHT+IHupHoDeRSYPT0dx3hRygn+QHc5Bt8mtT5qSWmKc439J7DjJ/oEFnPnU2XCnX03Xc/8m5lG X-Received: by 2002:a05:6a21:4995:b0:1a7:507a:c9f4 with SMTP id ax21-20020a056a21499500b001a7507ac9f4mr1920936pzc.30.1713520390039; Fri, 19 Apr 2024 02:53:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713520390; cv=pass; d=google.com; s=arc-20160816; b=siQRKJnc5MBftbIoBkEriVhmBPhEFvi66bw15UjIBl3FGIrE+21IOtxTPZBM2bDEpT ZgQNFhdzURFABe6jTBuGPv/IsH5v5Sk6gUy40SYW5H4BVClpep9Lw6+/CsPSIUqtTPCW b1IoXdwelfZFvBBDZ5KhcjTxkQKwAU4iY0Nm538fwU0NE3OzsJwR6shcBQqcqKKR0Wsn 6H9az/KI03z8SnKiljL5Vhe7Tg0qDtJNuHtH6c9q38lEmaIbgZNuEHOB8Dq3oXmfDInM rajkiSknI3Iu3okc/27M+Bf4Ak2NgqTqvQEyxvnHhSV2QRKD5kT089ADS+DH4aN4Q8AT Z0jw== 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=PtHT2dnCrKtU2tz1OyJJw1d0hzBN/YL8p+52UQFaJZo=; fh=1xZg+ZmbOtDZWPEk+2J4+gkOsQKR3OsYG52AZsHbluc=; b=tlLgxmdxgWJkb1wO5EdXO8kAXWOW29PoHK72KAd+1v/UNtmb7ogsEWd4TTS+wwsvGg ktCXh8Zjcx4eezXDYDc3gRrH2imEhcf49KNh+/q1NCsD4SvarK1PKgc0LfECfWYjCLEG mtqzALKtewU3vl5V8am84J5VYxNCBQ8VXtIlephv8OztkjjM3Q/Zdcqj4WQp9TEesVaA NGvhIrZOGMxMeZ2tQKtNrVJBVTFa+IeGWnA7L5jYYbpZ+bIJHiLoTJ8JUrWfXXS0DpTA Eyn0ltdiP/w2Suq1zOyIyovwlwZ640xq32zrjLl+Jbq5zLtKwdfS/m+sORAInLJOKBlo llHQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dwHJJPHO; 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-151257-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151257-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id w24-20020a63d758000000b005f782aeef44si2960369pgi.317.2024.04.19.02.53.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:53:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151257-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dwHJJPHO; 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-151257-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151257-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id A73AFB21D97 for ; Fri, 19 Apr 2024 09:52:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5235685628; Fri, 19 Apr 2024 09:49:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="dwHJJPHO" Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (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 367037C092 for ; Fri, 19 Apr 2024 09:49:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713520174; cv=none; b=JuDKh1AT+lSsQY2Ht3qGQ6sf/IQdI5VtojymycangR7UdaAtiJToZzzKo7wfajH4LdrMaSIM01ShO91QZUk3Yks22/pY2Pi+qfdb/j8CfvKauBVbTnSEJ3knABsHytPcO4S2QIEfKaT3w6Wmq3M621lQcX3hUjiQ0diON8ApVZo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713520174; c=relaxed/simple; bh=aAxsx+GHEjYnJMiAWqwUDNgaIzi1dYkLjFRqwX4O4Cc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Rs5zQU8hjA9I0rfa8qFGedrupQL/Jc9sWIrasxIs4n2g/490U++B+xYPKDFPVf42ocm4pvk16XItvAz6S8UPL7vFxAHxoSR2Rfvw55QWocPLHx72OrflFv/Ly4qgWug5zKGfGqw33dEk0o/fq/m/nY4G3+SKpxn1H4N/+VA3o+Y= 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=dwHJJPHO; arc=none smtp.client-ip=209.85.160.179 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-qt1-f179.google.com with SMTP id d75a77b69052e-439073cd4c9so525431cf.3 for ; Fri, 19 Apr 2024 02:49:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713520170; x=1714124970; 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=PtHT2dnCrKtU2tz1OyJJw1d0hzBN/YL8p+52UQFaJZo=; b=dwHJJPHODXiKSarwV6nm3I3I7P1+j5DULH4hERbmBQjxOW8dPVI+RDJZUUshs1f8Sx FnQG7TFdVgOvfTpO9qxTZ2PdFm1Zpe+LBeM8luYze/vuxxBN06/Y4hxuEaNATaVdT1aA DJ1hYwJj6K8xXoYGNdInHHjg5Zfcq0+/lQfNI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713520170; x=1714124970; 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=PtHT2dnCrKtU2tz1OyJJw1d0hzBN/YL8p+52UQFaJZo=; b=t7EfVKAJy4qQpEQWrR0q6OOer3PmHffgCCZZ1DYdCIQbJpmT5fcPkrsKzlykWEm0xO 9qQ7D0zjEKh0a1tWW4iKJpB+SQqIlsUdUBaHvIQMs5DPbyype8EDcx5gvrJCc0k85/vB znoFqkmiQ9VkhvCFkMrTQFMPAkZpPtyaYYUARhUU1SG4P1zf9dSOAw0ZTEOtOC26qOnH MYk41e8ZkfqYhG0U/cxrgrhqhKKciW3WBXvpGwPhTjcEZsIKVdAMLe+dvEGusADcKKrf 6P8ik7x7SjhVg219ZY5xgL+ZfKqAg1he+3hteu3Zd/+exlkomJrwXAZ9rnHgFS1kjDcs aJ6g== X-Forwarded-Encrypted: i=1; AJvYcCWbypCuPQTslNZRL/YpSOc5iQbaADD2EdNxZd4u0fP0lj9BkmT2+MnY8i8dNWl68MLV/8P6QOD2ep0v3al4GR7juU4picgUBF+5geT+ X-Gm-Message-State: AOJu0Yy5Lsoq0ciUUDoT7AVfBYZ4ZyKPo5421NTQUGlIMueHR0dJSoDo XncV+gJ4XPx/Dj83gin7TIFp6eD35ccGI672WsZXC9jovUr4iSD7fMWJdl3Rv32mCrEzWDNMGdS 4aA== X-Received: by 2002:a05:622a:1386:b0:437:b995:98b5 with SMTP id o6-20020a05622a138600b00437b99598b5mr1747672qtk.57.1713520170255; Fri, 19 Apr 2024 02:49:30 -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 dt14-20020a05620a478e00b0078d735ca917sm1434532qkb.123.2024.04.19.02.49.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:49:29 -0700 (PDT) From: Ricardo Ribalda Date: Fri, 19 Apr 2024 09:47:55 +0000 Subject: [PATCH v2 09/26] 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: <20240419-fix-cocci-v2-9-2119e692309c@chromium.org> References: <20240419-fix-cocci-v2-0-2119e692309c@chromium.org> In-Reply-To: <20240419-fix-cocci-v2-0-2119e692309c@chromium.org> To: Martin Tuma , Mauro Carvalho Chehab , Laurent Pinchart , 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 , Benjamin Mugnier , Sylvain Petinot , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio 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 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c index 4bb073587817..915a9f3ea93c 100644 --- a/drivers/media/v4l2-core/v4l2-async.c +++ b/drivers/media/v4l2-core/v4l2-async.c @@ -316,9 +316,10 @@ 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; + struct media_link *link; -#if IS_ENABLED(CONFIG_MEDIA_CONTROLLER) + if (!IS_ENABLED(CONFIG_MEDIA_CONTROLLER)) + return 0; if (sd->entity.function != MEDIA_ENT_F_LENS && sd->entity.function != MEDIA_ENT_F_FLASH) @@ -326,8 +327,6 @@ 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; } -- 2.44.0.769.g3c40516874-goog