Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp1447324lqt; Sat, 20 Apr 2024 16:23:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW5VmoTzLUzUM+q7RyAM2svub04FnYcaMpdLtle9/+I9fIdey7hhEUvm5MqaJuq+23kmFpHtkMQaUO7cMuOTLmq2IVuoPb9waIOYBDcrA== X-Google-Smtp-Source: AGHT+IFxaALJ4fY+/oPgJpzFsVWmDeyyOCYt8TfBtu08tL4lNdl1rsNVtZahnAgviDnlnt9DnsVC X-Received: by 2002:a05:6a00:1794:b0:6ea:c4b3:10b7 with SMTP id s20-20020a056a00179400b006eac4b310b7mr10000614pfg.17.1713655403841; Sat, 20 Apr 2024 16:23:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713655403; cv=pass; d=google.com; s=arc-20160816; b=QSPejDYSScNvMnrVk6O4CDW6VyRyXuSL1SP5Pj53YYzd2hX/ZenhFniVVIpxU4NJvI 1PnALfSFwS5GSC2Z1/8sqx6vOxq63Sisy7Wq+v/yKhkNAeJsCfdJWPhmwTV9usNlNnj/ ItPav05OLUD+8KRGpn/N6xJ79+exSxZ1v9aEyC4CAE6oPwgBX7hgDjUyNg6ZhW4pv3YU weQZEbcGGaQoCChwmE2/AJAHerFNwdz+eq2jYGoOn77eyne1LLpemaiw6ucqLHvhkOV9 VuaOc8zkHFkqbz/zFQGs/dZYJFT7bdHRujMiX0M4xV1bDZ1SLbZRXEd7MEmOWk4DVvGC MPkQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=G7j9WmKVfIxCtxmA5+g+ivZQajcRB8Ss1Yyb3DxCAfA=; fh=2ruQO380F9EPCAjZH0xuk4T6kkHoRWUkYbpFXEjo14M=; b=iN8vhDoal/REaCdJMKILW11zubyXnrhJBsRNh7oaobXIfDZ2zQPOpgT0el13+covoR Vppjl+Aqea1JvxBpBRxaqys+1dlps+kjLWMSpCgwxyCyPp2evMPGEvOTKBoEJjIFcjoi KqWLfkxpUkpkY/HGY+YJ6BU2vhCYtrhpFdr+mNqtjVjyjkctf0TslK5Kndg0LvjZ7/ln FzSdefkFLdvPABCFAOYVLCSgvVqcxzj508d7KxqlpnuEfJfJkdIQR0zmd+UYI7zEdOLd rFXt0734FjxCWxoFPKAX7/+sQGrdb3VDStJI1W0B0prDOuiuNabtfyBbG/TIuVCdN2+1 Z3VQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UMNw0TfY; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-152391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152391-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id jo6-20020a056a00908600b006ead14a16dcsi5623442pfb.17.2024.04.20.16.23.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Apr 2024 16:23:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UMNw0TfY; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-152391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152391-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 674D0281257 for ; Sat, 20 Apr 2024 23:23:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C7C74F21D; Sat, 20 Apr 2024 23:23:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UMNw0TfY" Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (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 CCD98495F0 for ; Sat, 20 Apr 2024 23:23:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713655394; cv=none; b=WAt7Rc0W2VTWs/zigtAcgB/rKMCFYsTFr30Jt2cwjvGJplNZqCpwhBtW7DDweal2ASzBTYTG8VBdPlBltDYSzESmO3xylYtniXn6qYdsrEAaszHyf0B3UYV+UZ80azpTcqqNnKHLqZNySHgMAYMDk3o69gsztMfoQ4YaX6pN/lE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713655394; c=relaxed/simple; bh=bBNbxTaDfIJVcjkaQmgCFXE6pXweSy07pk6tkP8ChP4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=uo5/jCuzTshnxO4OUVPbVaA92Q78sJSdxPLtqPlaTpFtzNoFLB8oUqa5vq8NjE95HbKPZFn830br3+LIJDsAwy7gSQnu9KZdoMG1TR+84NV3j7CKdxqjl2KQqTvUS6a2svZhXoPZmwcI/5g+XEB0Tw+ZktVO0I9q5GO8jypJBQA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=UMNw0TfY; arc=none smtp.client-ip=209.85.208.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-56e56ee8d5cso4298566a12.2 for ; Sat, 20 Apr 2024 16:23:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713655391; x=1714260191; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=G7j9WmKVfIxCtxmA5+g+ivZQajcRB8Ss1Yyb3DxCAfA=; b=UMNw0TfYERYCM73Fq3Dfxfa5Nka7eEdWP9KeNxkaioU40XArRH47xzepKqoU2hhwCX b+dG1RBOcQs45R3gAJUzXUzZvZub3wnRBgTjWhpaPxZIptbWaphPb5nVDFAuUvJq4jI8 UPZYhuWMAJSVqenLIVmJ4xR9TGXvnI1Iv92AdQHTkrW/3cOShxU+zzVaRt5aPHrMhMKi RCtHNsxaOmGUuc3q8TqcuMLa3mSmTJIxlnBkb0B5AQAM+scdAVilZ9EIuvJCLh4sdCeR cN3cnCp5Qks5PxR3rc7JWD825iRdublNaQcBKGnLfo+lcDRtKkH/12CqHAPTrnPJ2MjC Z7Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713655391; x=1714260191; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=G7j9WmKVfIxCtxmA5+g+ivZQajcRB8Ss1Yyb3DxCAfA=; b=dYK5iO5AcZVLJ+Iq1e7qW6BMPu/LsUCRRtsZoWNnsNORyy6vTEJ1CvORdENDaCzc8G pti7KLLjAqwXYSimZHYUgRKPH7GT4ryA9hO39LpfUmX0BT+BLZW3CmufuVEnqpQtcX7A TXYAuNaHRFLnpT5j3oNXs1OTnJTqc1k5hTtREagJ/bdgp/7cvOcWOjCAAnYFOHs6/HFL ocXjaaIpwp96tt6teTFt/NLjOcaH4c85p3MYwOyJGXbEKCJHtElFW6NJSnDHEd81xZ+9 sM5Y8NFMT1f28xSrZL5gf+LSUBBQ+uaUaH17r0lgUuLYMpwLU3q+uyoXh1AJJ3gVdJtv ewjg== X-Forwarded-Encrypted: i=1; AJvYcCVazPrJy/u8+ZCWZPMZ9+V4nrfOT0LlPwXulGE6/ZiDlNorJHKt58x4+XqpK1hVZsZG89xizc8WT3E+uIme71ym7Crn39tTaZ0nWnFB X-Gm-Message-State: AOJu0YwLjgJh5YNpyDcRAUxcm9k2pvCCRUOwfHQIcu5VRFRDCvxDV5Yn r3xBWAiYGQS8WhVyjEstW7m3Ad9zYJBHT5BRLGJZec76mRESzkIv9kUYl1TDJis= X-Received: by 2002:a17:906:c24d:b0:a4e:5137:9969 with SMTP id bl13-20020a170906c24d00b00a4e51379969mr4156927ejb.32.1713655391076; Sat, 20 Apr 2024 16:23:11 -0700 (PDT) Received: from [192.168.0.102] ([176.61.106.68]) by smtp.gmail.com with ESMTPSA id v24-20020a170906339800b00a521904b548sm3889268eja.166.2024.04.20.16.23.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 20 Apr 2024 16:23:10 -0700 (PDT) Message-ID: <27513574-3131-4704-9c3d-f699cc9edb9b@linaro.org> Date: Sun, 21 Apr 2024 00:23:08 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 09/26] media: v4l: async: refactor v4l2_async_create_ancillary_links To: Ricardo Ribalda , 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 , 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 References: <20240419-fix-cocci-v2-0-2119e692309c@chromium.org> <20240419-fix-cocci-v2-9-2119e692309c@chromium.org> Content-Language: en-US From: Bryan O'Donoghue In-Reply-To: <20240419-fix-cocci-v2-9-2119e692309c@chromium.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 19/04/2024 10:47, Ricardo Ribalda wrote: > 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; > } > > Reviewed-by: Bryan O'Donoghue --- bod