From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Walmsley Subject: Re: [PATCH 2/2] clk: Move init fields from clk to clk_hw Date: Tue, 20 Mar 2012 17:47:42 -0600 (MDT) Message-ID: References: <1332214706-675-1-git-send-email-skannan@codeaurora.org> <1332214706-675-2-git-send-email-skannan@codeaurora.org> <20120320072018.GC32469@S2101-09.ap.freescale.net> <20120320094031.GI3852@pengutronix.de> <20120320141811.GF32469@S2101-09.ap.freescale.net> <20120320181050.GN3852@pengutronix.de> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Return-path: Received: from utopia.booyaka.com ([72.9.107.138]:46119 "EHLO utopia.booyaka.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751270Ab2CTXro (ORCPT ); Tue, 20 Mar 2012 19:47:44 -0400 In-Reply-To: <20120320181050.GN3852@pengutronix.de> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Sascha Hauer Cc: Shawn Guo , Saravana Kannan , Mike Turquette , Arnd Bergman , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Andrew Lunn , Rob Herring , Russell King , Jeremy Kerr , Thomas Gleixner , Shawn Guo , Jamie Iles , Richard Zhao , Magnus Damm , Mark Brown , Linus Walleij , Stephen Boyd , Amit Kucheria , Deepak Saxena , Grant Likely Hello Sascha On Tue, 20 Mar 2012, Sascha Hauer wrote: > [ C99 structure initializer elided ] > > This will make a 4000 line file out of a 500 line file. Now when for > some reason struct clk_divider changes we end with big patches. If the > clk core gets a new fancy CLK_ flag which we want to have then again > we end up with big patches. Then there's also the possibility that > someone finds out that .lock and .hw.flags are common to all dividers > and comes up with a #define DEFINE_CLK_DIVIDER again to share common > fields. At least we can understand easily what is being changed. Readability, particularly by others not familiar with the clock data, is more important to me. So like Saravana, I too prefer C99 structure initializers. At least there should be a choice. Quick quiz: in this line below: imx_clk_divider("foo_clk", "bar_clk", CCM_BASE + 0x20, 0x5, 0x3); which field is the bitfield shift and which is the bitfield width? :-) - Paul From mboxrd@z Thu Jan 1 00:00:00 1970 From: paul@pwsan.com (Paul Walmsley) Date: Tue, 20 Mar 2012 17:47:42 -0600 (MDT) Subject: [PATCH 2/2] clk: Move init fields from clk to clk_hw In-Reply-To: <20120320181050.GN3852@pengutronix.de> References: <1332214706-675-1-git-send-email-skannan@codeaurora.org> <1332214706-675-2-git-send-email-skannan@codeaurora.org> <20120320072018.GC32469@S2101-09.ap.freescale.net> <20120320094031.GI3852@pengutronix.de> <20120320141811.GF32469@S2101-09.ap.freescale.net> <20120320181050.GN3852@pengutronix.de> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hello Sascha On Tue, 20 Mar 2012, Sascha Hauer wrote: > [ C99 structure initializer elided ] > > This will make a 4000 line file out of a 500 line file. Now when for > some reason struct clk_divider changes we end with big patches. If the > clk core gets a new fancy CLK_ flag which we want to have then again > we end up with big patches. Then there's also the possibility that > someone finds out that .lock and .hw.flags are common to all dividers > and comes up with a #define DEFINE_CLK_DIVIDER again to share common > fields. At least we can understand easily what is being changed. Readability, particularly by others not familiar with the clock data, is more important to me. So like Saravana, I too prefer C99 structure initializers. At least there should be a choice. Quick quiz: in this line below: imx_clk_divider("foo_clk", "bar_clk", CCM_BASE + 0x20, 0x5, 0x3); which field is the bitfield shift and which is the bitfield width? :-) - Paul