Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp260497lqg; Fri, 1 Mar 2024 04:41:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVbpOGm+vZUWVBFLs9D9Zf5Kz5K3gkAjDdiVwBNAb4AYWT96+MfB/XtVAOkdJEEXkcDxqqL1OGGKgcRxwKPFPDQoTCTy5HaMo9SLMX5Dg== X-Google-Smtp-Source: AGHT+IHgfK5YuBytKVTxatTwsMM1IlYO978YJ0vfpyt7G5s6PNgcjPE/CF1uomN/7srs2epNAZJm X-Received: by 2002:a05:6e02:1ca4:b0:365:89a4:a7a4 with SMTP id x4-20020a056e021ca400b0036589a4a7a4mr1721108ill.32.1709296872030; Fri, 01 Mar 2024 04:41:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709296872; cv=pass; d=google.com; s=arc-20160816; b=f9bwoy+cm89Ih16Sk/1RX10/fyTfqDzKEwpEc8qWnjnKh2xHG0MS5N7D9NMePbgFby qsjPXAsngxW7Ag3RNsfMfhmBYjkEYEg71sx3G44SGckc+WhNINt/cuPokOfHEV7ZhzCC +hT9+zTFg21MMFy0OOpIy94DrZdH2m72ZPWgXM+DnmNtLr51nEGv1Tp7YB3UNYWGlVyd iosDt4zrIvBCJ7utCP3oxp3Ta2BbL/7EmKEtPW6mY2msnucnUeWaKyoh8FBSSdPVDMGm tIAiG9CgBCzZNLmfJdq5rZhqG5RvAhTEAH+lG+qdwCl9G3tvLov6BgocF3RHQaxyDWAc nvVg== 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=RnUx3Q7X8FFtd5yh+tGbbMgfmcLuWjo0Ilx+jqmLjYw=; fh=XZn1jXWqOIJ4bYa0ovJSYx5FZ1Uv81hzCVcHqSP+77U=; b=ZiH0TIUShUSuMpFlt292osX1xaQCLbjtXnLtdzMjvIonvNiIzi+j3nzdW35WbQbNCV ZtqH8EsFgHadMsG6LKbjSHO0l56Oc2k4wlx3rvpM2Wl+n6hKsuhZdynzWLvHuyMbU4gX 5KFaCF0B9zgxf0oa2zLtfP/eDTOVdFv1gl/kQXRWJ4++8pAA3hRaAikXuWXQ+MJzNXHD sBcBzFQamTPE1TLpccbJaeXUi4eSm+LP6lRkLsXE4FHLnYI8OUbATKAPv8NEIFtNB9RF roTJbh5QO4YVfSQGEDLEpEOzWlHJenHtzGMr7zJ09L8qaSYZFlBK827dzzHR/VEFqWlz 1n5Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EecX3Ws6; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-88137-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88137-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id l185-20020a633ec2000000b005cdfa589cfbsi3487130pga.148.2024.03.01.04.41.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 04:41:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88137-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=@intel.com header.s=Intel header.b=EecX3Ws6; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-88137-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88137-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 5CD8E28279B for ; Fri, 1 Mar 2024 09:03:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E10DB6A33C; Fri, 1 Mar 2024 09:02:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="EecX3Ws6" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5AFB767E7A; Fri, 1 Mar 2024 09:02:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709283769; cv=none; b=lZR0jqgnECyZ46vd+51yWAJNQ/4WngMjPOxHxd2PJQShOA5u9gwLp2uoopEq9BgAQ6odovPj7Tgnsoo7yzeY4gu+ULNFvPMXaEpOWYvhLwtvhyts8fOJGAqFJHFNoNXB6Uwl9yGOjY4wAdDklnLN3rZov/R8rpBa4lvPY8PXcYE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709283769; c=relaxed/simple; bh=rg/9tIV+l6rkm6nBFZtaGTD9o47J4VCrowIfSPkATgw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oSVyY1eL/cmjO0hftSXCdHX/XZK4DlbPU/89FbK0GEaHScNwifanZect9Unx7c73fF7FlLDBErskBlXI8yHkVZ17CaHGPSzmuTtczAmcM6QuvCM+GXFaj4MT71slixH6I96Nxd9O5F93yFTz9W7XDoo4HMXrt+2ZT2Fi/4+ZCdA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=EecX3Ws6; arc=none smtp.client-ip=192.198.163.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709283768; x=1740819768; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=rg/9tIV+l6rkm6nBFZtaGTD9o47J4VCrowIfSPkATgw=; b=EecX3Ws6lW1uJpBxuBmm09vDErzA+OQNFPSUETeRoL7OA/Sr7UYSiPwM pfnrB9d0ejgAbV4moq2gzNODaWsNoa1KSOIHceej/TfqTc/Y4qvwPF5fH nw32wytvNI9qNCDZJFR+9JS2y3N382a93kHfvNJXaJATuKonl0KhL0WM1 CYqq5DZ1CgMvrQmq5LGJwzr5ZWL0sk1VGOiYhpTlGA8n/oZc+O6JbfNMN 3C3sXMfU0hQcePMKEz7nNe6aOinZG12BR5pfqlcpbEaPoDFeHryFR8ngn lO53sVt0IaM+MEhNGRfGuC/9V2R17yVDb3RRMcqeITsEIbYuam2vDq5ik w==; X-IronPort-AV: E=McAfee;i="6600,9927,10999"; a="15223600" X-IronPort-AV: E=Sophos;i="6.06,195,1705392000"; d="scan'208";a="15223600" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2024 01:02:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,195,1705392000"; d="scan'208";a="39156675" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2024 01:02:44 -0800 Received: from kekkonen.localdomain (localhost [127.0.0.1]) by kekkonen.fi.intel.com (Postfix) with SMTP id 60C9511F811; Fri, 1 Mar 2024 11:02:41 +0200 (EET) Date: Fri, 1 Mar 2024 09:02:41 +0000 From: Sakari Ailus To: Tomi Valkeinen Cc: Markus Elfring , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org, Andy Shevchenko , Mauro Carvalho Chehab , LKML Subject: Re: [PATCH] media: i2c: ds90ub960: Delete duplicate source code in ub960_parse_dt_rxports() Message-ID: References: <79fa4854-976d-4aad-86ac-c156b0c4937e@web.de> 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: Huomenta, On Fri, Mar 01, 2024 at 10:49:19AM +0200, Tomi Valkeinen wrote: > Hi, > > On 01/03/2024 10:46, Sakari Ailus wrote: > > Hi Markus, > > > > On Fri, Mar 01, 2024 at 08:46:25AM +0100, Markus Elfring wrote: > > > From: Markus Elfring > > > Date: Fri, 1 Mar 2024 08:23:24 +0100 > > > > > > Avoid the specification of a duplicate fwnode_handle_put() call > > > in this function implementation. > > > > > > Signed-off-by: Markus Elfring > > > --- > > > drivers/media/i2c/ds90ub960.c | 5 +---- > > > 1 file changed, 1 insertion(+), 4 deletions(-) > > > > > > diff --git a/drivers/media/i2c/ds90ub960.c b/drivers/media/i2c/ds90ub960.c > > > index ffe5f25f8647..eb708ed7b56e 100644 > > > --- a/drivers/media/i2c/ds90ub960.c > > > +++ b/drivers/media/i2c/ds90ub960.c > > > @@ -3486,10 +3486,7 @@ static int ub960_parse_dt_rxports(struct ub960_data *priv) > > > } > > > } > > > > > > - fwnode_handle_put(links_fwnode); > > > - > > > - return 0; > > > - > > > + ret = 0; > > > > I think it'd be nicer to initialise ret as zero, then you can just drop the > > assignment above. > > I don't like successful execution entering error paths. That's why there's > the return 0. It could be called a common cleanup path as what you really want to do here is to put the fwnode handle, independently of whether there was an error. I think the current code is of course fine, too. Soon you can do struct fwnode_handle *links_fwnode __free(fwnode_handle); and forget about putting it (but you must need putting it). -- Terveisin, Sakari Ailus