From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B0EF6C433F5 for ; Fri, 22 Apr 2022 15:51:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NCsgVXIhAjagAfxbXTfL3sYOfH7TLrbIbtVxmv+5l3s=; b=cLPFWO8HianyNG DkhDi0fuqbyFxWl+Fw0P0uIU83bSSPs/NNY4La8iBxMpy1aHcd6Vgy7cKipy5lbtNAFHCz+qMimaM p2RlPEAuMc8sklGV+n+wtssXZQ1fIDMPCM5685lYKn/g6PNSGAXvHkHZQTvuZiBa65P3+NqiCrz2a iVC4MPYM+bZEL/ZWbU16lV0qU6P4kNnlpM2sNPEZelRgucN8Z7qY1yr70pl7hIkWNlAfe1yZRskfH a/NMr+9t+jAXBj4iOKZCD4dmMMqU12yD3KBw6LtVxzgShwGv83jO+Uc5wN0wlhm+HnX4gWTK1n2el rDyWshqjZwpMvB99sEFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhvYG-001Dzo-RP; Fri, 22 Apr 2022 15:50:33 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhvTx-001CLF-SY for linux-arm-kernel@lists.infradead.org; Fri, 22 Apr 2022 15:46:07 +0000 Received: by mail-pl1-x62d.google.com with SMTP id d15so11675728pll.10 for ; Fri, 22 Apr 2022 08:46:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=FtnwU85lnk8sSVybc4V8F5kwU+53RMkF858SpDu4W4c=; b=dho5RsqambxA38U/b8dtZxHYePuXRkM5VG38erLwn98MAIanO0ERA8V0D0EBmRKdc4 6C3dExRddMz3AnZz38Rdw7W0kSyMOSIYvn3Z8BFarKpFWEYkQ0xVwLniVQaDOekIhtBk fb6KAaoaPymk0FOlwfvjxx04pQG2Qe63OIh62EW0bJ6Wr5mh2ooxayMqK4zoceF6Jluw 1xFfUtB9Ih912Zp1w6bD2uO1qT1Rd3Yn4cBmhCB9hABRR918VMLRUr0Jt0YIwSUvWbXS JnnGCgywmlzjCu0ygDzOux8GzcUF2VCfCOt20cDkqQ+DsOsUHdMpksCJHqWjagET8KzK MsZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=FtnwU85lnk8sSVybc4V8F5kwU+53RMkF858SpDu4W4c=; b=pd2qlRj0rCXyVgSfC7nDIKSX/UERQbrWM9TW3STrEfUSiZFrrhgvwQkYN2zw+gog4S WsNRQZ6PCSPlOhJP4T6ES7xsNKoyjYiq9hp/Dix6C/G/N2J1r0oHDqh4qqIBH0tRGwdZ rLNEOxUKnxqvc2VrprglUADY63SxZdKoGGJPTJRqyxCTrW0MY/P2q/VE7YrB9WHKpb71 Q7OenNhtuTKDEpwPgoFAyuKmzzypOA8j6eeyrTg/yDKpOq6iI7BDuXgRnYBwiqBUXxuM sADhk5A1KAIvUh7lB8tGQT8hCX4Zofvw3V7ZrfIUkxbeIT3PpcCJ6iWXRVGWo4HRqIO1 xTzw== X-Gm-Message-State: AOAM530/qdGvkIlOG7o1yBOHg7lYdZK1YoEMyC6p//eYohRRXGX2ZDeS QZgNecQqjp5buMbifC36t7Zylw== X-Google-Smtp-Source: ABdhPJyCaufYMGfH49S9tJ9BFjQjU1VO/TTxeD5SbwIuD/iC2w8QBWfaKvbB+ittwN0L/nqbcIEAeQ== X-Received: by 2002:a17:90a:5d08:b0:1d7:9587:9288 with SMTP id s8-20020a17090a5d0800b001d795879288mr6296218pji.204.1650642361964; Fri, 22 Apr 2022 08:46:01 -0700 (PDT) Received: from p14s (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id 16-20020a621410000000b0050aca5f79f5sm2997037pfu.97.2022.04.22.08.46.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 08:46:00 -0700 (PDT) Date: Fri, 22 Apr 2022 09:45:58 -0600 From: Mathieu Poirier To: Shile Zhang Cc: Suzuki K Poulose , Alexander Shishkin , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] coresight: etm4x: return 0 instead of using local ret variable Message-ID: <20220422154558.GA1713394@p14s> References: <20220422020239.37186-1-shile.zhang@linux.alibaba.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220422020239.37186-1-shile.zhang@linux.alibaba.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220422_084605_980178_51CB66E7 X-CRM114-Status: GOOD ( 26.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Apr 22, 2022 at 10:02:39AM +0800, Shile Zhang wrote: > The function etm4_remove_dev() always return 0, and the former function > etm4_remove has been changed to void in commit 3fd269e74f2fe ("amba: Make > the remove callback return void"). But now its changed back to int type > for some reason, which is different to the stable branch linux-5.10.y. Please spend time understanding why function etm4_remove_dev()'s return value has been changed back to an "int". From there you will likely come to the conclusion that adding the above to the changelog doesn't make sense. > > Just let it return void and return 0 directly in it's caller function > etm4_remove_platform_dev. The only rational for this patch is that etm4_remove_dev() always returns '0'. And even if it was to return anything else, the return value it not checked. And even if the return value was checked, there is nothing to do about an error condition since the driver is being removed. > > Signed-off-by: Shile Zhang > --- > v2: re-work the commit log from Mathieu's suggestion. > v1: https://lore.kernel.org/linux-arm-kernel/20220421164217.GB1596562@p14s/T/ > --- > drivers/hwtracing/coresight/coresight-etm4x-core.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c > index 7f416a12000eb..141f8209a152a 100644 > --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c > +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c > @@ -2104,7 +2104,7 @@ static void clear_etmdrvdata(void *info) > etmdrvdata[cpu] = NULL; > } > > -static int __exit etm4_remove_dev(struct etmv4_drvdata *drvdata) > +static void __exit etm4_remove_dev(struct etmv4_drvdata *drvdata) > { > etm_perf_symlink(drvdata->csdev, false); > /* > @@ -2125,8 +2125,6 @@ static int __exit etm4_remove_dev(struct etmv4_drvdata *drvdata) > > cscfg_unregister_csdev(drvdata->csdev); > coresight_unregister(drvdata->csdev); > - > - return 0; > } > > static void __exit etm4_remove_amba(struct amba_device *adev) > @@ -2139,13 +2137,14 @@ static void __exit etm4_remove_amba(struct amba_device *adev) > > static int __exit etm4_remove_platform_dev(struct platform_device *pdev) > { > - int ret = 0; > struct etmv4_drvdata *drvdata = dev_get_drvdata(&pdev->dev); > > if (drvdata) > - ret = etm4_remove_dev(drvdata); > + etm4_remove_dev(drvdata); > + > pm_runtime_disable(&pdev->dev); > - return ret; > + > + return 0; > } > > static const struct amba_id etm4_ids[] = { > -- > 2.33.0.rc2 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel