Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp593831lqo; Fri, 10 May 2024 08:53:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXQ1O2AajZTFGyeZROKzEph/9B7ULRgnHcxZEACMz00ukhImO7Le2F/Vv4TV7vwBaEtdinNj9CSzHzVfR8Ic3wYe9zcGrBWxI07vdmBDg== X-Google-Smtp-Source: AGHT+IHWk1OwjQgXtUfRrRqjpPbX+Mdaty5Khz3gDP8OnRKWISIwjyNrGfrZs4+G2zj2u0m/cPrt X-Received: by 2002:a05:6358:9046:b0:186:1193:8ccd with SMTP id e5c5f4694b2df-193bcfc6725mr315675455d.23.1715356409503; Fri, 10 May 2024 08:53:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715356409; cv=pass; d=google.com; s=arc-20160816; b=sdXA7zqUbb0MkCBHgB44c0oDf/n8bSw3oUK0Pbgt8YAFvbJZs9cOXw5bFI6E4zknZh m20yoLDHSAHEYkP1vaQt1shwWyZhPEnvxz3arfYX1JoNNXgVvM3wUlK9a3F9WqbWb9uy dLRKNyz+JH+/BfgrF6o44l4kVS5UbnEyreCzaS3kxDOaad5EVSXAuUpxUwOdzAx6A7/S SvUOr61aP13lDoHAjZj1TMy4jyZ1w508z6o0CxiuIle0oQVUF1AvDGv+BUQPNhidZwoY x1KWLjctFs9n0oC+tGAIcEjsVntIT4ptWiB++spEKKo4oDBW30zNrHPYkx2nMKUybAKM suUg== 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=2SvsmHCpODoy89CrS+vfoFWJWpXjhvL02T0hTQzQxWk=; fh=boEyIxe85w9K+jCY3si80Uo+rtlbqkaNVIqFTZS2KOQ=; b=xcnopdqaFb1sVGZ5BTit6OilAyfdTBc5Stm9vp3M8fN/RkRmP2Ecc1r3b6Nlz7J/BO mXmT4SIoeComFSkEHosFTr6Ol133g+E9Z3r7ZKdc7yO/tZ+McV4FK8/my511CMOIAeb8 ExNyeBAYHnpx6sUy3rW7nImdJHtCwKHQpjUru2BtSaSDeh5yZ2jCb/gP5BzkJVpqyz3F 4i+MuSyEM3RUJnpnEBCGVhdPEkXRZLTM/Shzp4Zqv2OpCRGaSKV3Pe/+p6tDUIFxs+Xa y8w4GHSULHHaABawrmNYQbcvNevhZ7gv0sjLxBLtN+0rBGY52Mh9gq29J7o+tlYiHWaz ATAw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QE2cuNad; 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-175971-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175971-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-63412e1f4cesi3830155a12.749.2024.05.10.08.53.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 08:53:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175971-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QE2cuNad; 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-175971-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175971-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id A6E03B25AD6 for ; Fri, 10 May 2024 15:43:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C08F0171E4C; Fri, 10 May 2024 15:42:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="QE2cuNad" Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (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 6B318171657 for ; Fri, 10 May 2024 15:42:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715355775; cv=none; b=G8t9sVFeDyqfBSPA3ZkXcmFgV1MQ1uVo+x3zsIJgKUa3tAgj/owXjxA/VGsgp+21fJNXdjqte2Ots+0ol8c23nm43w3OblMxndSnOiRwSAxsaN/7Cs18uPl7pzMo19ENcCl+KGOSWOgWgsoEzR+9iyq7aB24yA7nVAkGWOMT/Kc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715355775; c=relaxed/simple; bh=h2tc+97CygyL1h403nfPfEVVm9uKiWnPtJxLm2rKHPA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=G12YJOvBy5eXbMFABgPYQCkLTK90KLSYbHP9dr01pxiTdyOpU2nI/4pu3PnQotsdYpga2b3YWONCBOrpTjTs5411XcCrjTBKidhPSk3YGkVBPL6e4i57WfAJ5HHBBfD6HL2E6sPwthDxcdkYbtWfMLPbtRqKRN8WA/svRPbwICs= 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=QE2cuNad; arc=none smtp.client-ip=209.85.218.41 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-ej1-f41.google.com with SMTP id a640c23a62f3a-a59a609dd3fso383077366b.0 for ; Fri, 10 May 2024 08:42:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715355772; x=1715960572; 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=2SvsmHCpODoy89CrS+vfoFWJWpXjhvL02T0hTQzQxWk=; b=QE2cuNadznm9ufxvbQe5b8sAulpvexyuEijQbXuC7bqFXEu+t5BzVurh1GpJbtYiRa TZuB3dgwbDigaehqcF6Lt8s9VPAgtQJ0XsyeGta7gVnDq3RrUGibV48LSYE1pcaaAxDl 82OFkQbmDF5dusEskK1PkDm9XmEfrsrGYhn7kaVhahXVda9KhtVleJOFRrjKB1a7m12F ePrAEGg4RK49mYnZdTUqAUmIkVUlXWvOQVs+vzlmC3ackChekbW0BKe/Y2Kg8q8LAq/V AUYCSF3QW0OsORCs7OOhf2fvqOKiBYNyA2OeQqB+b81IiQwD3NMtpAsaQRpGzT+zgALJ xv8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715355772; x=1715960572; 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=2SvsmHCpODoy89CrS+vfoFWJWpXjhvL02T0hTQzQxWk=; b=gydt+qqNkZMfcIrqkVcsnIeHvUQq3c64Zw8a6Nk+kaHNa2DJ9BLIK4Cx5lIbheGtjN HjDKU2QViCR0b+hiCeI8gTxZ5qskk+eh4e2E4E2syy8Od8+c1ipuBsvGAG0Lsh3mBFkf fDQwsBMzPtZsUqzBKSTM8Q2pX0DhiGyNv2nvJEyfxlaXs0PFRzI9vrs8K3Xh1S3ExljN F6HXkIqRob/XShGVxG8Rkqf2VC1fSXCK9NtBsclod709G1W2BgibTZ0gkyYzsyOFIBd9 Fu2gDal4R1cEy5a+Y7irYyKxdT6duhQ6L9E3SVI0QiaVeE5Desj15dpnyKKOUq6y4Lnw A9YA== X-Forwarded-Encrypted: i=1; AJvYcCWJYSPFWKXJyvIcGy2qi50E2MJScALj/kVHHkjbchrT8gADGevOQGp/jydam1GfKiXM22Or51o5xSeVZYnAI3dyQOn/BKrC4kpie8uh X-Gm-Message-State: AOJu0YyoRPsno4g7y5lNHfAqovp5wvHNthYjnywwowunMUoDnmwMcWQX JrgaCnXw9Wf7SJRMYOID68GU/yayB94qG6TJf2a7sMELRytk3czMS4xNWQ/+j1Y= X-Received: by 2002:a17:906:6890:b0:a59:c8e4:e195 with SMTP id a640c23a62f3a-a5a115f3dddmr483170766b.14.1715355771630; Fri, 10 May 2024 08:42:51 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a17b17a06sm193619766b.219.2024.05.10.08.42.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 08:42:51 -0700 (PDT) Date: Fri, 10 May 2024 18:42:46 +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: <57a0dfae-cf1b-4c98-bc54-e70e722adf99@moroto.mountain> References: <71dad56e-0e2f-48ba-90bc-75096112a1ba@moroto.mountain> <4ade89f8-cbd3-4dbf-81fb-0e9a4269dc0f@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:36:36PM +0300, Andy Shevchenko wrote: > On Fri, May 10, 2024 at 06:27:30PM +0300, Dan Carpenter wrote: > > 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. > > Is the generated assembly the same? Yeah, it does. regards, dan carpenter