Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp779181lqg; Sat, 2 Mar 2024 01:14:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXpMtwzWVTyIoPyafuszwZXHVAOshTHVXjI121116K4pCQL3dmDAX4IKy2kSYCyzjcBZE00Y+dUW18p4Q6XR4yxyJvj0aUXSIfyNESOiQ== X-Google-Smtp-Source: AGHT+IFbILwn8YFgMayhBmI7DMFnnjfe6x2yng9SQDM0as/6qjfy8cx1AoaGdxVIEAR1dzbxybHL X-Received: by 2002:a05:622a:550:b0:42e:ae33:ddd1 with SMTP id m16-20020a05622a055000b0042eae33ddd1mr4216563qtx.31.1709370856293; Sat, 02 Mar 2024 01:14:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709370856; cv=pass; d=google.com; s=arc-20160816; b=MxiXXkmeVFp7pinWfvYmsDAUk71eeOd2JatFbkRGp58+Fq0jS635x32eSMKOMQI2zf 6gtpIc2hv7h+AQqr7qKI2/CLVusr9J/69MqDLrP2S8c6C81KhHbFxUR9xLXEfXxSHZrW Sww8zibST4g6DT+kdsCa/Rji/hQEBPrHOXB54sQM0JFNBPsB5drXxLhTqtpzIlfYdi+H D9DYDTeyROGxBEnKKclfjf0W74YXZ1NoVMYJ2tLv8klF4G6/kJs9COJ4oSpqc9xucR35 qn+Cey6+3wMeSEY8C09rBcNu3rVBXf0HRasXc/vRJL5YTcrirjo2fAD3ajLG7ZJvESbL uFTw== 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=DFSpcwT4Hy2bJfwJLXbvIJSYRBInQpfC3lHF7abplN0=; fh=olcgryty1OKS8luR5p2E3JB/uuWfN616nYxLGgWjsqo=; b=StS6F+rAqmcBplJiUWsbM6IZbH8C6oxKuZpaE9ugRhslkb1Qxtbq8e17YpnF0VLlvT e/stI4wQzi/bsTon0558FH2j+oUK3on+6Efebt3eHZ8fBz9OpoGRiSYgcT8c+0Ep1yyd zYiM4a+hEMACTG0Pf+pZBmVHMlJr0GQi1e3Ile5Bjg7T3FxWKOvUYEUMnZGkVFN+enlq pOXXjN/WS9I21Pe3dM1bcms135Nq9BHj1MHDydW6dUUxglbBTfCTHlQjrgqGuFv8UPL3 vYkhXGtQw87jlRu3KezabXpmVM5m4iZ5Ivu0kSUuW+6ted/b01XFaT9e2mj9Z38cAtb+ xAmw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TyzyDhVy; 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-89391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89391-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j7-20020a05622a038700b0042ee0502067si142304qtx.537.2024.03.02.01.14.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Mar 2024 01:14:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TyzyDhVy; 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-89391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89391-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id ED4AF1C20DE0 for ; Sat, 2 Mar 2024 09:14:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 526B21400A; Sat, 2 Mar 2024 09:14:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="TyzyDhVy" Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (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 B0382376 for ; Sat, 2 Mar 2024 09:14:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709370847; cv=none; b=fIZA2oYSAOimLvDsJpqjlaKCt9vLiMqEc+W0MT2VAMrxgyFkspzgkOM8eTVQct2H1Jwd9fA33fPJvZG33/UfgTA+Oq3pJItqKyDf4VdSNir9uvNaZ7O865AZc59wkSeb4tHRHB9y7fxqZZ+juSzJ+Qxm/uWbJPl2mYYQoQa7mFc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709370847; c=relaxed/simple; bh=AQCHu6wjC1Mc61DwzXSbpHVMgu3N08Sag4neGTjHap8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Mn9FuFsiEGm+/YAHYgNXi4LFLj/WibWYRVldk+q1fhZQOZyZHl9+tuoiZZCMohDJkuIHEpcUSNlUo2MMW5Nxd14TwrT1YfPA2Gz3zXlUyV6lYB4KI4mqKFR5fP21l7g60eRtR5e8G+dC5pwFhnQGIMtYP/tF9djZF1C0L/9z0+s= 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=TyzyDhVy; arc=none smtp.client-ip=209.85.218.47 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-f47.google.com with SMTP id a640c23a62f3a-a4429c556efso458949066b.0 for ; Sat, 02 Mar 2024 01:14:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709370844; x=1709975644; 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=DFSpcwT4Hy2bJfwJLXbvIJSYRBInQpfC3lHF7abplN0=; b=TyzyDhVykPJyXTVESsrhxoch0+bBcNML8ayZyTOIlmiUJlvLSNocu76IrF//dhYNHT D5ZKcSshJIkRd0VtR5WG8ul12ginmdsDbM0xkmj7pBbqhMcbtNGLtFxSswUIjK+brm04 C/zBMUxlBeSPPK7oLOBc6oNtgHdBRjFmC3fafPeIWJlA568cufqfyt5y+hEL/k0w6QMM nqDortpPlKMM2sJJDyxwfRKn0ijAcD262kURRZ9A9tLr5/OXXApD1l18rfbGsCMywS5V wnICBIC3EEl5lBhsuHJEIOpmbaEhgkptCal5r10karvwzZwtFejLy++qS+Dd3TC5LDIm 4UDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709370844; x=1709975644; 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=DFSpcwT4Hy2bJfwJLXbvIJSYRBInQpfC3lHF7abplN0=; b=Nhqqog3kIwP3tY718yV9g82+yHm/idIK+ssgUYqASoPcEJJH8Qpn26tNdeBT8uxPaf xRTMIwMKAWloXXP+FSj8OdXlS4rATZmVPKz09+VCA4kBvUeHgXdNa3UKg8C2UW6Kh+Zt GR2VSYarP7uHC7Y39I71m3v1lSPCQgJhtaKjyMZWquk6mY74KAHvpLmkKlzBb+gwcSNz 7jL7UpbLw44lI2TtpzQeKiGnhNZrksQpS6Z7/CA7XsO/IKeQ+yBoJE0xjJcOrrkGRd6/ WEsiuwglTWgKaz64KZ7k9u3mDIeOVwE6XIb81NN90pVCODLyvrXymZDGyVOHXXccOoAt WwWw== X-Forwarded-Encrypted: i=1; AJvYcCVvY5NipFIdf7EyYOuuvX9R0Cyjyt0qaKBEvH10y7WA0oUfD+ChR2tXEvv+fDEpUrV7HCR8arjdiftCtjsyfV20oCkYHVTCNPSD7pk+ X-Gm-Message-State: AOJu0YxrUOMZspiv2WSE5u93G7gDDa9uA1/DawBHk74Wa8MEKivlY7pP ln0fAD+FKFpT+1/ssg3w0U3WLeHw7GE/wEy9ELEordWjjptDanSH9rCgOwplFlY= X-Received: by 2002:a17:906:80cc:b0:a40:2998:567c with SMTP id a12-20020a17090680cc00b00a402998567cmr3019889ejx.41.1709370843819; Sat, 02 Mar 2024 01:14:03 -0800 (PST) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id c13-20020a056000104d00b0033dfa7ecd33sm5901777wrx.61.2024.03.02.01.14.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Mar 2024 01:14:03 -0800 (PST) Date: Sat, 2 Mar 2024 12:13:59 +0300 From: Dan Carpenter To: Andy Shevchenko Cc: Sakari Ailus , 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: <8ece4c88-dbc7-4327-ac2a-0a097fc990d0@moroto.mountain> 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: On Fri, Mar 01, 2024 at 07:36:17PM +0200, Andy Shevchenko wrote: > 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. The __free(fwnode_handle) stuff has already been merged. We could do some additional work to make a _scoped() macro for fwnode_handles but here it's function wide so we already have what we need. regards, dan carpenter