From patchwork Fri Apr 19 09:47:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13636057 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 191D6C4345F for ; Fri, 19 Apr 2024 09:50:55 +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=KM82oMkmWt4TWykQPh04VOE1ABrq8U5Ac4hZChkqxsQ=; b=MB373JPfY1ubDb wTzm7ZT/rP0D3zQBrcbcEbhul02RO7/f9OsnJsboJA/Cn+IAteHCzZlO71njGMvqksag1zoabyQQc KZ7hgATyrV7mmh+Qmbt35g38bKUgOLu8ODP6rTjsbylXUBkjs8iuEQzGFxn7k/Sl7UkS0o0vn6AcJ mojAIikMxkdNhd0nKF/IJdNv1wUV4pppf43E0UKXXN/Imre7ayAkLk3DHTb51eN4BRjeRAaF4NOyr n/ED7I4WSD5xy8b2uwJUQK4PNcnT8SW8chlBQDQioQ9Ff/v+rdvOJUY32g32JARS38yxus+FHgliW LhQ8rjXW6rFy9Oh04zKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxktH-000000059es-1saA; Fri, 19 Apr 2024 09:50:43 +0000 Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxksC-000000058uY-3yRZ for linux-arm-kernel@lists.infradead.org; Fri, 19 Apr 2024 09:49:42 +0000 Received: by mail-qt1-x82e.google.com with SMTP id d75a77b69052e-434925427c6so10410701cf.1 for ; Fri, 19 Apr 2024 02:49:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713520170; x=1714124970; 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=PtHT2dnCrKtU2tz1OyJJw1d0hzBN/YL8p+52UQFaJZo=; b=QbubsKQ0dQ+5noqXTAxNFKR2sq+wOmJTvgqGm5VsF9dBBl9zbx/JAMYpddQJs0K4OW dBospUaOEvX+obVsUlv4RQTenjsed7gSccfGy1Nu8V+VSmzOcDH9SkJQlwfMZ4ruR1/S 42Bxkcxvls/wElR57Iox4ZtJJGdmImkdzAdrs= 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=O2ijtNtzT8LuGepcU2/h48ktIGhro+lRSK3r5+kJiJ1dwoDjdg5K6eSfda/F38VR74 323bsYVsAWJEHpdPaAOI8dI3NN80qL9ccIUMYO41uxZMynZ7m9zlP2ZqyUaaJvOklPoP nQaq0A5r8mh93s4hM68D+ko286IGspgJFhricdMq4WhHdnIBxjU8ZUOZ8YvDdM233jjE qFTatb3WnP1EINL8TXNzATqkUbzH17MSikgSuyHn595zJW8A7LqAaFOximMWsUQBkGEL ZQMnpFSstFiDALJWLO4igzeDwQpNLBiQOSGzaaccFmbv7Hlm94ErEgupqFaV8C8hajDT gHuA== X-Forwarded-Encrypted: i=1; AJvYcCUd2RZU+dSNu2nK4GK/o3ltyRJQOZj71Aw88xUU7lt/bQBv+MUEQMXZeZAIZfr8YPwPZORVjG5eZ8hme7KFRhwmwlkCjRQnjl8Y9eMfdEibScKyAJo= X-Gm-Message-State: AOJu0YwidhnqoDrf4WogcvLF9k6TE2230ykdMsGfunMR58hDcFp6zcBM xpuNvR9kEvUPpSbBuadJ/Hm4nb7Dc0Yiuza2a6/LoRbZvrQCuZ+ggLGsvcoJ+g== X-Google-Smtp-Source: AGHT+IEq5/HFwcn26nQnIIJ8VXOEY35h4vBPeSOiEtFFD1Z7vC7s7kPOFrGUrC/lVDARzsxRqq1juw== 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 MIME-Version: 1.0 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240419_024937_155593_CCB5AEFC X-CRM114-Status: GOOD ( 13.24 ) 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 Reviewed-by: Bryan O'Donoghue --- 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; }