Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp578843lqo; Fri, 10 May 2024 08:28:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXyOUZK3bunjSGysok8tjhki4XOX9Nbrf18pwuAqCd6NJWvxJmPYdcRfhCf04fPob2S1gFj9dVlr3sTpuWfZ187FZdNQ3XPYlMU5F8MjA== X-Google-Smtp-Source: AGHT+IF+buXfrHzOOXDDBOrOO/78gYROdsPFQuCgkBv584Os0JfdhsI3BiSjNvhxnTlXYFCOkFNd X-Received: by 2002:a05:6a20:9747:b0:1af:8fa8:3126 with SMTP id adf61e73a8af0-1afde07cd39mr3121424637.6.1715354918353; Fri, 10 May 2024 08:28:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715354918; cv=pass; d=google.com; s=arc-20160816; b=P2p+XK9wFeHc8U2z8CLC82Ohwtlv3fqmx4oBnorzi8yn34J1MNt4uvcrbxW4QGDu7O wRKkWAhMNpwayG4hkGTTkzNNAJb0CwdHo7W02qr0xx4RKVOj4A5FxrYHIZEwRbeoHIsl 6B6A7/N7Ac2eXWarHt0sAiruqBWLCfZss6cCK7mySWgxLVS09SutHQ7fwEqVaP2arHUG EUr6JuxZr1gLpdmznW+8yQio82WQsnJqLYhRiW5b7VQbqTXJL91qdA0O5BKmFn2dBLMG ++znjg+O2OPhFzZeQja/TCXlozm4Pi+njPd+y091AXmCDw6cx8opdGzTEaPER4GYRpu1 b08w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=a5FOttH9EQLp2QP0x59iAJre7V/D35J8XRWRgV60AP8=; fh=/5ncKwZ7fgwbzIhF3wIRbUYOJHjiwjWrBS18Wz4oLLM=; b=LEgvRqpYCIOBmHjuTZ5wTA2pgcYkR2PqGN0PAK6PzCKkpdUj/YJFaao8CsAmOkDREd bTy6716d7s9HIoMDJaavVgQlse255r7lxnJNdxoGv+9NMP9N7vB6i3VUH/WhFsCyrFri nU8Sv+tnJnmPT8hkRIg4nqh+INxlzKdhs9ME4F6ABauWgEmGGffczlMJW6Rqk/8HpUiX iV88xnJHrUJLppP3slGibyc4K1/GaFNgHCxFdhzRM9muUi7jC+cfS3oB3zOWm61Ix6zr UXRdQ4pxmCKkxXQfKIHSi6QPoLSM2SQJuMzujUsorh7xKqUqVnYrOSGI+15SCDomdqP7 eICw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=faBOMB8o; 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-175945-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175945-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 d9443c01a7336-1ef0c153591si40267975ad.511.2024.05.10.08.28.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 08:28:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175945-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=faBOMB8o; 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-175945-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175945-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 F06C22877AE for ; Fri, 10 May 2024 15:28:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 185A5171E62; Fri, 10 May 2024 15:27:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="faBOMB8o" Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 10528172BCF for ; Fri, 10 May 2024 15:27:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715354864; cv=none; b=QR1HLQZ4P0uO/frO3Fd7qyRb/JnhWgk7Z0bKoVUNrpU+v5C7YwvtZ5uDOwoAY4wlMypB+e4wQHLNSikh2IfnR8CBHwkJLapf1BYqmg70xmeOXW3WDYFozLBVCM6gM0uIaSggJVB/t1Qks1fKr50PcVK1vmAvXSe9rLKdMoH5xjs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715354864; c=relaxed/simple; bh=Jzdc2H2hNULa1a9dJybZhyaGjAWp+NC8/yUTJ8Z3H5o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qAZflcr487HSxwP3FfAuNkdGeZXksVCDA0RD2tgrEPSOFUCOZnl8bDpetxaYWO5jK2tCIV9nbh94pbqLgInQpD+Bn88u0ZxOoZz7EraoBIELYIYPhKTGnfLIbpywUZB/P/ceUdUS+tMjZUbeENsRuTfWFW5/cH3SxLYzjRcyg78= 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=faBOMB8o; arc=none smtp.client-ip=209.85.167.45 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-lf1-f45.google.com with SMTP id 2adb3069b0e04-51fb14816f6so2688761e87.0 for ; Fri, 10 May 2024 08:27:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715354854; x=1715959654; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=a5FOttH9EQLp2QP0x59iAJre7V/D35J8XRWRgV60AP8=; b=faBOMB8o6QE81pOcKmx0/FRnSBMxxpDIhA0Wq/pd5m8P6lNAVaMjIL6AD0jAFA6FHS hiP6IcpyjBUdLL0qg6Bd3liXJ8yZrUpQba38xyf3jXZ15YWgtjH35imQPJJOItmXXb88 UHW5TRX0b3HtZPDNBIcn5GKMYC01FUfXdpKdZ4qRMR7yrH93LALT369PYJF4nvsSvatX mvt2bCzP6Td172qdgBNG1Q92K0Di4rORIWuCi0Ea2ox4iXhJJhT7NmIVEAWkcGDOoa7P Rr1t5ObpwJ/egOVxY2cVbQU8510scxMk1xS+MRY60A1u4EJaYp48+v/Y0WJCG3DpgWGi HoNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715354854; x=1715959654; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=a5FOttH9EQLp2QP0x59iAJre7V/D35J8XRWRgV60AP8=; b=uRAvH4bhhyLCj+YP4DzeexZuP8ppMdrBx8L15buX+TvSjq1pakx/aI+92PjhPOJR1M /EYeKCldbUcY649Z4KfJ37c0YE3mxUhCfIxsEcQGude2/pVBV2sZ5EiXTptJryny1Yok 97E6w2tO0z5DGqG5Vw+jv4TIUyDGrHPv5ugc2t/th+svLWRSqJZyjU7ZUxhy6j8tDcx1 Wlh3HbhXn6hy5tY+1SknmVj+cK8aC0TNUJmztvE9NIsf2atQJ9EPMBuWuOIcy+LuDfts M1GBsS28U77LVujC2HSXhMrmMsJIBEdWuRfWvF0i83dFZZD5qYlGUl/7e3U0nr2O67mQ UjZA== X-Forwarded-Encrypted: i=1; AJvYcCUjIS5LDGu4Yqi5qmOhpso9JQS3vFNgm5yZPT+hBcWWd8SZChIJn39L4h37ghRScyx7URaXh1d3MXI+x933dYIZtNwHKN1ZyVyD91Lx X-Gm-Message-State: AOJu0YynmwI6e+emvkDk4plkxOC+AYeqYlEqWyCrCc+OmGQDBQX6jlxp npT3w9PCx4IKbNDlWJK0ToTlViAoZCaoGCGvZLSt/7nZQg5S4J1Nmu3DMYGMhnA= X-Received: by 2002:a19:a40f:0:b0:522:f6:9268 with SMTP id 2adb3069b0e04-5220fc7eed8mr1735865e87.31.1715354853669; Fri, 10 May 2024 08:27:33 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a1781d553sm195973166b.43.2024.05.10.08.27.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 08:27:33 -0700 (PDT) Date: Fri, 10 May 2024 18:27:30 +0300 From: Dan Carpenter To: Andy Shevchenko Cc: Bingbu Cao , Mauro Carvalho Chehab , Sakari Ailus , Hans de Goede , Daniel Scally , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] media: ipu-bridge: fix error code in ipu_bridge_init() Message-ID: <4ade89f8-cbd3-4dbf-81fb-0e9a4269dc0f@moroto.mountain> References: <71dad56e-0e2f-48ba-90bc-75096112a1ba@moroto.mountain> 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=us-ascii Content-Disposition: inline In-Reply-To: On Fri, May 10, 2024 at 06:18:22PM +0300, Andy Shevchenko wrote: > On Fri, May 10, 2024 at 06:10:37PM +0300, Dan Carpenter wrote: > > Return -EINVAL if "bridge->n_sensors == 0". Don't return success. > > ... > > > ret = ipu_bridge_connect_sensors(bridge); > > - if (ret || bridge->n_sensors == 0) > > + if (ret || bridge->n_sensors == 0) { > > + ret = ret ?: -EINVAL; > > goto err_unregister_ipu; > > + } > > I would split: > > ret = ipu_bridge_connect_sensors(bridge); > if (ret) > goto err_unregister_ipu; > > if (bridge->n_sensors == 0) { > ret = -EINVAL; > goto err_unregister_ipu; > } It's always hard to know which way to go on these... I wrote it that way in my first draft. It's my prefered way as well but not everyone agrees. I'll resend. regards, dan carpenter