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 X-Spam-Level: X-Spam-Status: No, score=-14.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 937A9C433E0 for ; Thu, 11 Feb 2021 19:06:25 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4D2F364DCE for ; Thu, 11 Feb 2021 19:06:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D2F364DCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:Date:To:From:Subject:References: In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VHZbr37lw4gISUlPUuuv0l4Yh58AsCELOU5vQfzsGCQ=; b=KJM8PqpHWEWQzk4EbkmnmtMyq wAQ8uxyEIUSv7yoJJtgxmM2oVR0U8tNRqE7lLnQIVLehCVTqVcHRZzq9foIZzgZMGpeary0fSLf15 x01/RN5BpBSFtgeypMum0ZmJQmM1ovXyWc2ho2+OHsrO0tyZHDlrVP64Hyf797zPY7lXXuJpCInbL hbIXGlxvPkttm5+yOTDxUjf35z52XbCDP0je35dS6w/reG/VgOgvJE3KIgQ+uSzYptvBsa+Gg80g8 GtonFV6MOfdZEShcwHpktpbghD/0AgLP5UOfrcaf1RduZF/BJtmi0zALZnuoD5k1DZkixQY6z5FWL DFdiyqGeQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lAHHC-000645-Ih; Thu, 11 Feb 2021 19:05:18 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lAHHA-00063W-HN for linux-arm-kernel@lists.infradead.org; Thu, 11 Feb 2021 19:05:17 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7012164E6C; Thu, 11 Feb 2021 19:05:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613070315; bh=8kiRepUjNeVgukin7TwKjMbpmdvai9OE+G45svt4vIg=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=a93R/82gY7D5m8xOkU/KHFaTjpv8x4alX0s0kgqDPvFY55ZWuEoc7LtergDH0gYVQ 4x0JTgu0DJfXdQIBzs/AVz//3RqJZai0dPBxoLSzi8bXYw/QyRj9H8X/H3xlJpD+uX ps2UwybyEVYGPebwlKT/ROVQyvMGFLMZIBKksp68dMPH/ouEvcrIrOTNLxKRmZxbI/ N19DJek89EdQAgC7bkvh5DR4/29KOoBFw5czdHkxgYrOlMrp1WP3C6okC9uU+vg9PV 16Ucqf8z3a41+3B2510XhEsCEe2Q/ye328aXkWTJn7sQ4mJOoxumGeaWcQKzHh1olm uhYdilhVfKKOg== MIME-Version: 1.0 In-Reply-To: <20210211073906.GC30300@pengutronix.de> References: <20210210184938.146124-1-colin.king@canonical.com> <161301409895.1254594.6980739457487251623@swboyd.mtv.corp.google.com> <20210211073906.GC30300@pengutronix.de> Subject: Re: [PATCH][next] soc: xilinx: vcu: remove deadcode on null divider check From: Stephen Boyd To: Michael Tretter Date: Thu, 11 Feb 2021 11:05:14 -0800 Message-ID: <161307031421.1254594.40010291545314425@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210211_140516_730273_772C2C1A X-CRM114-Status: GOOD ( 20.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Turquette , kernel-janitors@vger.kernel.org, Michal Simek , linux-kernel@vger.kernel.org, Colin King , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 Quoting Michael Tretter (2021-02-10 23:39:06) > On Wed, 10 Feb 2021 19:28:18 -0800, Stephen Boyd wrote: > > Quoting Colin King (2021-02-10 10:49:38) > > > From: Colin Ian King > > > > > > The pointer 'divider' has previously been null checked followed by > > > a return, hence the subsequent null check is redundant deadcode > > > that can be removed. Clean up the code and remove it. > > > > > > Fixes: 9c789deea206 ("soc: xilinx: vcu: implement clock provider for output clocks") > > > Signed-off-by: Colin Ian King > > > --- > > > drivers/clk/xilinx/xlnx_vcu.c | 3 --- > > > 1 file changed, 3 deletions(-) > > > > > > diff --git a/drivers/clk/xilinx/xlnx_vcu.c b/drivers/clk/xilinx/xlnx_vcu.c > > > index d66b1315114e..607936d7a413 100644 > > > --- a/drivers/clk/xilinx/xlnx_vcu.c > > > +++ b/drivers/clk/xilinx/xlnx_vcu.c > > > @@ -512,9 +512,6 @@ static void xvcu_clk_hw_unregister_leaf(struct clk_hw *hw) > > > > > > mux = clk_hw_get_parent(divider); > > > clk_hw_unregister_mux(mux); > > > - if (!divider) > > > - return; > > > - > > > > This code is pretty confusing. Waiting for m.tretter@pengutronix.de to > > reply > > Can you elaborate what you find confusing about this code. I would gladly try > to clarify and improve the code. The fact that pointers are being checked and then bailing out of the function early, vs. doing something if the pointer is non-NULL. > > What happens here is that the driver registers a mux -> divider -> gate chain > for each output clock, but only stores the gate clock. When unregistering the > clocks, the driver starts at the gate and walks up to the mux while > unregistering the clocks. > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel