Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp609404lqg; Fri, 1 Mar 2024 15:36:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVExlno5dkOMT7qtCWFVeK7wHrYOMyBOO/Hd6VxmsjGTGPNmAkJVKQPhH9s3K6FWHRwRfA8TecO9YF9myZzvcM3LLRJU/sF5iUzdXOZow== X-Google-Smtp-Source: AGHT+IHmIx1Q2/BVuwTLR2ehrIAex36yBwZXqY98RmSsS5byHhDDg618Ar9xmaZB562GwnzHQPc2 X-Received: by 2002:a05:6a00:18a9:b0:6e5:3372:7c0c with SMTP id x41-20020a056a0018a900b006e533727c0cmr3442052pfh.2.1709336171739; Fri, 01 Mar 2024 15:36:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709336171; cv=pass; d=google.com; s=arc-20160816; b=gTr1Tn41dnMJnGvWJ6CJ9zO9wtyAb+hCL45SwZsDiQJHY5EAFfndCebpm14VkWAFvj qQvKJ8YsLlhYzh9XK7VFe7DWrDdLrLJ48yGmlf6SAk+kY4MqaRMldFNq90TbvhOSdkHl HuuciO5rnbpD3vo9hTG3xW37qPriFVRmcWG8xKR3bLj+mFDL1wv+GfwCZ0tr3/3fzW/T ey4R/wTB4Vi11KFE2AMzAALNNOLnHeY2ewvQSNQA0lKXQBYHWJcSHfQX4oxLjmdwOnxo 4cQMf6yE1V4sLgrqyQ0T5eSoSKvQH7wjcrNJToQPv/gr1/da+33UCw1HMzKz7IgKn4Kr P4xg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization: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=64Vp0zhZOA9JHOK5YrdHOtzDXR7YGnMBHoi4nTPlBOc=; fh=/zApwJTTAVSBnNdG2PJtHwHT1ZdHUPbMLMlAxUqnbiM=; b=CEw9jBweUR+drqjvqpLJ5c/GrV0U/cdEDEH1r0gMQAE5e0fHleW3eHk8COpDUxrqKP ClaYX9TKsrTDMWIN2HQG+ZAw89/Y0B1ez4bHh8+Ex+oK/w4YS6znNaWosYZ9Mh5F0CVx q6lMIQAUrwyl55f9sESHsMkSFrKl1sV9bj2kpYsXkoNfh3X+VuHRW1silmJ57tOWz1pA aOOHSDrUOBBw5One8Y6uL3OqSU9n4IQKfQgmtcIcy4amLCswoIrd0JtsMERv0r2Uc4z0 Ady5f3SkPtxvrUw87/XHye0yhQ6vxaN+qciCxOQ0tViIdyw1vVFo2EAo9Tfzbp57R61S tcsg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eNjJPaaE; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-88847-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88847-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 h10-20020a63c00a000000b005e430f68ae4si4514877pgg.549.2024.03.01.15.36.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 15:36:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88847-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=eNjJPaaE; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-88847-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88847-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 92F25290F52 for ; Fri, 1 Mar 2024 17:37:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6769827459; Fri, 1 Mar 2024 17:36:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="eNjJPaaE" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 0490E8C17; Fri, 1 Mar 2024 17:36:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709314584; cv=none; b=ayHEeZFRKSm2Z29uOwDCo887p6tKW/eLOYY4xNHAyZQ63jz64/q7/0t0NdY6WEbW528WXvTgz/nxtQy5LEUO582DxlNJA4oQ/TRi4O5dQr9LioOLiNwk/MXiBxnVxCp2XFOJyYhGaaCDFNeItPL0vrVtTXcXvf5ETofnE01a2Z8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709314584; c=relaxed/simple; bh=BLPKOOcms3NtQtohwHJmJbLW39B8h2SU5IMAJvs5Bio=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Y4jB1R1gN1mCtvPeV3r9XULGyvvv9eRD81vZwFvkLwWdYyvbjwOE7NruLbdgoNGjn5c+ghhZOHpN3KhWjS8BrIeyqIWoDyPJz+VI0CttiqKBfbDP8lQWFEyZNUhVbXU6IxzaWHjZRZZKd8tjaUd53VHWVHuBExH6CNq8pPI4irc= 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=eNjJPaaE; arc=none smtp.client-ip=192.198.163.19 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=1709314583; x=1740850583; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=BLPKOOcms3NtQtohwHJmJbLW39B8h2SU5IMAJvs5Bio=; b=eNjJPaaEmbg5eU4PYKJXt7RlYuL7t1g+L3qcnQS+9F0xAIrrrsHwEr8I vQ8TQ6/uB11yIz/EXdgKbUfM7y2QojghqM4jbSjPZ4n+DqoMDZ7k+65lm IdSpIVfMPaOpDrIIHG1Co0m76FDjymFtmt26sddYUey1xsOpCP0eWSRh5 wgBb+oN9pNuEcpYRF/tc9Hck558u/4KVXMAFpmkxZvebmizfcODDsYbXd WRHs0CKQpPwodKKPd44dsS8hABDQpi7+LtYoZu3ZlVuSChydInifL50ii W3uxM5oQXtnoEAcksl4AKE+gX0ER//JzlSHDCXZOaxJnDXr52LZ+OuwOa A==; X-IronPort-AV: E=McAfee;i="6600,9927,11000"; a="3724003" X-IronPort-AV: E=Sophos;i="6.06,196,1705392000"; d="scan'208";a="3724003" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2024 09:36:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11000"; a="914021132" X-IronPort-AV: E=Sophos;i="6.06,196,1705392000"; d="scan'208";a="914021132" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2024 09:36:20 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rg6nx-00000009168-3emF; Fri, 01 Mar 2024 19:36:17 +0200 Date: Fri, 1 Mar 2024 19:36:17 +0200 From: Andy Shevchenko To: Sakari Ailus Cc: Tomi Valkeinen , Markus Elfring , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org, 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: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Fri, Mar 01, 2024 at 09:02:41AM +0000, Sakari Ailus wrote: > On Fri, Mar 01, 2024 at 10:49:19AM +0200, Tomi Valkeinen wrote: > > On 01/03/2024 10:46, Sakari Ailus wrote: > > > 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 think tearing apart the assignment and its actual user is not good. > > 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). Let's wait for the Jonathan's patches to land (v6.9-rc1 I hope) and then we may modify drivers if needed. -- With Best Regards, Andy Shevchenko