All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@ti.com>
To: Vaibhav Hiremath <hvaibhav@ti.com>
Cc: linux-omap@vger.kernel.org, tony@atomide.com, paul@pwsan.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH-V2 4/4] ARM: OMAP2+: CLEANUP: Add new config option for different DPLL features
Date: Tue, 08 May 2012 15:50:06 -0700	[thread overview]
Message-ID: <87ehqui8yp.fsf@ti.com> (raw)
In-Reply-To: <1336506724-5494-5-git-send-email-hvaibhav@ti.com> (Vaibhav Hiremath's message of "Wed, 9 May 2012 01:22:04 +0530")

Vaibhav Hiremath <hvaibhav@ti.com> writes:

> This patch cleans up dpll_data structure, making structure
> fields definition based on feature availability for given SoC,
> managed using Kconfig rules.
>
> SOC_HAS_OMAP3_DPLL_IDLE: idle state
> SOC_HAS_OMAP3_DPLL_RECAL: recalibration capability
> SOC_HAS_OMAP3_DPLL_DCO_SEL: dco selection
> SOC_HAS_OMAP3_DPLL_SDDIV: sigma-delta div factor
> SOC_HAS_OMAP3_DPLL_FREQSEL: frequency selection
>
> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: Kevin Hilman <khilman@ti.com>
> Cc: Paul Walmsley <paul@pwsan.com>

Paul is the one to make the call here, but personally I'd much prefer to
just see the existing ifdefs go away[1] instead of adding a bunch of new
ones.  

Yes, doing so would add a few fields to a struct that may be unused, but
IMO, the improvement in readabilitly and maintainability is improved.

Note that the users of these fields are not changed and are still based
on Kconfig/Makefile values as before (e.g. CONFIG_ARCH_OMAP3), so to me
this creates another layer of obfuscation.

Kevin


[1]
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h
index d0ef57c..656b986 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -156,7 +156,6 @@ struct dpll_data {
 	u8			min_divider;
 	u16			max_divider;
 	u8			modes;
-#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
 	void __iomem		*autoidle_reg;
 	void __iomem		*idlest_reg;
 	u32			autoidle_mask;
@@ -167,7 +166,6 @@ struct dpll_data {
 	u8			auto_recal_bit;
 	u8			recal_en_bit;
 	u8			recal_st_bit;
-#  endif
 	u8			flags;
 };
 

WARNING: multiple messages have this Message-ID (diff)
From: khilman@ti.com (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH-V2 4/4] ARM: OMAP2+: CLEANUP: Add new config option for different DPLL features
Date: Tue, 08 May 2012 15:50:06 -0700	[thread overview]
Message-ID: <87ehqui8yp.fsf@ti.com> (raw)
In-Reply-To: <1336506724-5494-5-git-send-email-hvaibhav@ti.com> (Vaibhav Hiremath's message of "Wed, 9 May 2012 01:22:04 +0530")

Vaibhav Hiremath <hvaibhav@ti.com> writes:

> This patch cleans up dpll_data structure, making structure
> fields definition based on feature availability for given SoC,
> managed using Kconfig rules.
>
> SOC_HAS_OMAP3_DPLL_IDLE: idle state
> SOC_HAS_OMAP3_DPLL_RECAL: recalibration capability
> SOC_HAS_OMAP3_DPLL_DCO_SEL: dco selection
> SOC_HAS_OMAP3_DPLL_SDDIV: sigma-delta div factor
> SOC_HAS_OMAP3_DPLL_FREQSEL: frequency selection
>
> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: Kevin Hilman <khilman@ti.com>
> Cc: Paul Walmsley <paul@pwsan.com>

Paul is the one to make the call here, but personally I'd much prefer to
just see the existing ifdefs go away[1] instead of adding a bunch of new
ones.  

Yes, doing so would add a few fields to a struct that may be unused, but
IMO, the improvement in readabilitly and maintainability is improved.

Note that the users of these fields are not changed and are still based
on Kconfig/Makefile values as before (e.g. CONFIG_ARCH_OMAP3), so to me
this creates another layer of obfuscation.

Kevin


[1]
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h
index d0ef57c..656b986 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -156,7 +156,6 @@ struct dpll_data {
 	u8			min_divider;
 	u16			max_divider;
 	u8			modes;
-#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
 	void __iomem		*autoidle_reg;
 	void __iomem		*idlest_reg;
 	u32			autoidle_mask;
@@ -167,7 +166,6 @@ struct dpll_data {
 	u8			auto_recal_bit;
 	u8			recal_en_bit;
 	u8			recal_st_bit;
-#  endif
 	u8			flags;
 };
 

  reply	other threads:[~2012-05-08 22:49 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-08 19:52 [PATCH-V2 0/4] ARM: OMAP2+: Cleanup series in order to remove ARCH_OMAPx dependency Vaibhav Hiremath
2012-05-08 19:52 ` Vaibhav Hiremath
2012-05-08 19:52 ` [PATCH-V2 1/4] ARM: OMAP2+: CLEANUP: All OMAP2PLUS uses omap-device.o target so add one entry Vaibhav Hiremath
2012-05-08 19:52   ` Vaibhav Hiremath
2012-05-08 19:52 ` [PATCH-V2 2/4] ARM: OMAP2+: CLEANUP: Move omap3 dpll ops to dpll3xxx.c Vaibhav Hiremath
2012-05-08 19:52   ` Vaibhav Hiremath
2012-05-10 23:02   ` Paul Walmsley
2012-05-10 23:02     ` Paul Walmsley
2012-05-11  7:01     ` Hiremath, Vaibhav
2012-05-11  7:01       ` Hiremath, Vaibhav
2012-05-08 19:52 ` [PATCH-V2 3/4] ARM: OMAP2+: CLEANUP: Remove unnecessary ifdef around __omap2_set_globals Vaibhav Hiremath
2012-05-08 19:52   ` Vaibhav Hiremath
2012-05-08 22:38   ` Kevin Hilman
2012-05-08 22:38     ` Kevin Hilman
2012-05-09  8:59     ` Hiremath, Vaibhav
2012-05-09  8:59       ` Hiremath, Vaibhav
2012-05-10 21:39       ` Kevin Hilman
2012-05-10 21:39         ` Kevin Hilman
2012-05-11  6:09         ` Hiremath, Vaibhav
2012-05-11  6:09           ` Hiremath, Vaibhav
2012-05-11  6:37           ` Sricharan R
2012-05-11  6:37             ` Sricharan R
2012-05-11  6:43             ` Hiremath, Vaibhav
2012-05-11  6:43               ` Hiremath, Vaibhav
2012-05-11 21:54           ` Kevin Hilman
2012-05-11 21:54             ` Kevin Hilman
2012-05-14  9:23             ` Hiremath, Vaibhav
2012-05-14  9:23               ` Hiremath, Vaibhav
2012-05-08 19:52 ` [PATCH-V2 4/4] ARM: OMAP2+: CLEANUP: Add new config option for different DPLL features Vaibhav Hiremath
2012-05-08 19:52   ` Vaibhav Hiremath
2012-05-08 22:50   ` Kevin Hilman [this message]
2012-05-08 22:50     ` Kevin Hilman
2012-05-09  9:06     ` Hiremath, Vaibhav
2012-05-09  9:06       ` Hiremath, Vaibhav
2012-05-10 22:35       ` Paul Walmsley
2012-05-10 22:35         ` Paul Walmsley
2012-05-11  5:30         ` Hiremath, Vaibhav
2012-05-11  5:30           ` Hiremath, Vaibhav

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ehqui8yp.fsf@ti.com \
    --to=khilman@ti.com \
    --cc=hvaibhav@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.