From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sascha Hauer Subject: Re: [PATCH] clk: Use a separate struct for holding init data. Date: Wed, 2 May 2012 12:11:32 +0200 Message-ID: <20120502101132.GW4141@pengutronix.de> References: <1335419936-10881-1-git-send-email-skannan@codeaurora.org> <20120502095816.GG20478@pengutronix.de> <20120502100225.GB24211@n2100.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from metis.ext.pengutronix.de ([92.198.50.35]:37121 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752714Ab2EBKLw (ORCPT ); Wed, 2 May 2012 06:11:52 -0400 Content-Disposition: inline In-Reply-To: <20120502100225.GB24211@n2100.arm.linux.org.uk> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Russell King - ARM Linux Cc: Saravana Kannan , Mike Turquette , Arnd Bergman , linux-arm-kernel@lists.infradead.org, Andrew Lunn , Paul Walmsley , Linus Walleij , Stephen Boyd , linux-arm-msm@vger.kernel.org, Mark Brown , Magnus Damm , linux-kernel@vger.kernel.org, Rob Herring , Richard Zhao , Grant Likely , Deepak Saxena , Amit Kucheria , Jamie Iles , Jeremy Kerr , Thomas Gleixner , Shawn Guo On Wed, May 02, 2012 at 11:02:25AM +0100, Russell King - ARM Linux wrote: > > > > There is a mux->hw.init = &init missing here. > > What happens to mux->hw.init long term? Because once this function > returns, that pointer will no longer be valid. It's not used after clk_register, so everything should be fine. > It would be a good > idea to NULL it out in clk_register() once its done with, to ensure > that no one comes up with the idea of using it later. Enforcing this is a good idea. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | From mboxrd@z Thu Jan 1 00:00:00 1970 From: s.hauer@pengutronix.de (Sascha Hauer) Date: Wed, 2 May 2012 12:11:32 +0200 Subject: [PATCH] clk: Use a separate struct for holding init data. In-Reply-To: <20120502100225.GB24211@n2100.arm.linux.org.uk> References: <1335419936-10881-1-git-send-email-skannan@codeaurora.org> <20120502095816.GG20478@pengutronix.de> <20120502100225.GB24211@n2100.arm.linux.org.uk> Message-ID: <20120502101132.GW4141@pengutronix.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, May 02, 2012 at 11:02:25AM +0100, Russell King - ARM Linux wrote: > > > > There is a mux->hw.init = &init missing here. > > What happens to mux->hw.init long term? Because once this function > returns, that pointer will no longer be valid. It's not used after clk_register, so everything should be fine. > It would be a good > idea to NULL it out in clk_register() once its done with, to ensure > that no one comes up with the idea of using it later. Enforcing this is a good idea. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |