linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] clk: exynos4: Make exynos4_plls static
@ 2013-08-06 11:31 Sachin Kamat
  2013-08-06 11:31 ` [PATCH 2/3] clk: exynos5250: Make exynos5250_plls static Sachin Kamat
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Sachin Kamat @ 2013-08-06 11:31 UTC (permalink / raw)
  To: linux-arm-kernel

'exynos4_plls' is used only in this file. Make it static.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/clk/samsung/clk-exynos4.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c
index 68f9a4a..fec319d 100644
--- a/drivers/clk/samsung/clk-exynos4.c
+++ b/drivers/clk/samsung/clk-exynos4.c
@@ -984,7 +984,7 @@ static __initdata struct of_device_id ext_clk_match[] = {
 	{},
 };
 
-struct __initdata samsung_pll_clock exynos4_plls[nr_plls] = {
+static struct __initdata samsung_pll_clock exynos4_plls[nr_plls] = {
 	[apll] = PLL_A(pll_35xx, fout_apll, "fout_apll", "fin_pll", APLL_LOCK,
 		APLL_CON0, "fout_apll", NULL),
 	[mpll] = PLL_A(pll_35xx, fout_mpll, "fout_mpll", "fin_pll",
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] clk: exynos5250: Make exynos5250_plls static
  2013-08-06 11:31 [PATCH 1/3] clk: exynos4: Make exynos4_plls static Sachin Kamat
@ 2013-08-06 11:31 ` Sachin Kamat
  2013-08-06 11:31 ` [PATCH 3/3] clk: exynos5420: Make exynos5420_plls static Sachin Kamat
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Sachin Kamat @ 2013-08-06 11:31 UTC (permalink / raw)
  To: linux-arm-kernel

exynos5250_plls is used only in this file. Make it static.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/clk/samsung/clk-exynos5250.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/samsung/clk-exynos5250.c b/drivers/clk/samsung/clk-exynos5250.c
index df3628c..5865cef 100644
--- a/drivers/clk/samsung/clk-exynos5250.c
+++ b/drivers/clk/samsung/clk-exynos5250.c
@@ -517,7 +517,7 @@ static __initdata struct samsung_pll_rate_table epll_24mhz_tbl[] = {
 	{ },
 };
 
-struct __initdata samsung_pll_clock exynos5250_plls[nr_plls] = {
+static struct __initdata samsung_pll_clock exynos5250_plls[nr_plls] = {
 	[apll] = PLL_A(pll_35xx, fout_apll, "fout_apll", "fin_pll", APLL_LOCK,
 		APLL_CON0, "fout_apll", NULL),
 	[mpll] = PLL_A(pll_35xx, fout_mpll, "fout_mpll", "fin_pll", MPLL_LOCK,
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] clk: exynos5420: Make exynos5420_plls static
  2013-08-06 11:31 [PATCH 1/3] clk: exynos4: Make exynos4_plls static Sachin Kamat
  2013-08-06 11:31 ` [PATCH 2/3] clk: exynos5250: Make exynos5250_plls static Sachin Kamat
@ 2013-08-06 11:31 ` Sachin Kamat
  2013-08-06 19:43 ` [PATCH 1/3] clk: exynos4: Make exynos4_plls static Mike Turquette
  2013-08-06 20:02 ` Russell King - ARM Linux
  3 siblings, 0 replies; 8+ messages in thread
From: Sachin Kamat @ 2013-08-06 11:31 UTC (permalink / raw)
  To: linux-arm-kernel

'exynos5420_plls' is used only in this file. Make is static.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/clk/samsung/clk-exynos5420.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c
index ca352695..872e13d 100644
--- a/drivers/clk/samsung/clk-exynos5420.c
+++ b/drivers/clk/samsung/clk-exynos5420.c
@@ -727,7 +727,7 @@ static struct samsung_gate_clock exynos5420_gate_clks[] __initdata = {
 	GATE(smmu_mscl2, "smmu_mscl2", "aclk400_mscl", GATE_IP_MSCL, 10, 0, 0),
 };
 
-struct __initdata samsung_pll_clock exynos5420_plls[nr_plls] = {
+static struct __initdata samsung_pll_clock exynos5420_plls[nr_plls] = {
 	[apll] = PLL(pll_2550, fout_apll, "fout_apll", "fin_pll", APLL_LOCK,
 		APLL_CON0, NULL),
 	[cpll] = PLL(pll_2550, fout_mpll, "fout_mpll", "fin_pll", MPLL_LOCK,
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 1/3] clk: exynos4: Make exynos4_plls static
  2013-08-06 11:31 [PATCH 1/3] clk: exynos4: Make exynos4_plls static Sachin Kamat
  2013-08-06 11:31 ` [PATCH 2/3] clk: exynos5250: Make exynos5250_plls static Sachin Kamat
  2013-08-06 11:31 ` [PATCH 3/3] clk: exynos5420: Make exynos5420_plls static Sachin Kamat
@ 2013-08-06 19:43 ` Mike Turquette
  2013-08-06 20:02 ` Russell King - ARM Linux
  3 siblings, 0 replies; 8+ messages in thread
From: Mike Turquette @ 2013-08-06 19:43 UTC (permalink / raw)
  To: linux-arm-kernel

Quoting Sachin Kamat (2013-08-06 04:31:13)
> 'exynos4_plls' is used only in this file. Make it static.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>

Taken all three into clk-next. Seems like a lot of static-ization
patches for Exynos lately.

Regards,
Mike

> ---
>  drivers/clk/samsung/clk-exynos4.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c
> index 68f9a4a..fec319d 100644
> --- a/drivers/clk/samsung/clk-exynos4.c
> +++ b/drivers/clk/samsung/clk-exynos4.c
> @@ -984,7 +984,7 @@ static __initdata struct of_device_id ext_clk_match[] = {
>         {},
>  };
>  
> -struct __initdata samsung_pll_clock exynos4_plls[nr_plls] = {
> +static struct __initdata samsung_pll_clock exynos4_plls[nr_plls] = {
>         [apll] = PLL_A(pll_35xx, fout_apll, "fout_apll", "fin_pll", APLL_LOCK,
>                 APLL_CON0, "fout_apll", NULL),
>         [mpll] = PLL_A(pll_35xx, fout_mpll, "fout_mpll", "fin_pll",
> -- 
> 1.7.9.5

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] clk: exynos4: Make exynos4_plls static
  2013-08-06 11:31 [PATCH 1/3] clk: exynos4: Make exynos4_plls static Sachin Kamat
                   ` (2 preceding siblings ...)
  2013-08-06 19:43 ` [PATCH 1/3] clk: exynos4: Make exynos4_plls static Mike Turquette
@ 2013-08-06 20:02 ` Russell King - ARM Linux
  2013-08-07  3:21   ` Sachin Kamat
  3 siblings, 1 reply; 8+ messages in thread
From: Russell King - ARM Linux @ 2013-08-06 20:02 UTC (permalink / raw)
  To: linux-arm-kernel

Also note:

On Tue, Aug 06, 2013 at 05:01:13PM +0530, Sachin Kamat wrote:
> @@ -984,7 +984,7 @@ static __initdata struct of_device_id ext_clk_match[] = {

For the declaration above...

> -struct __initdata samsung_pll_clock exynos4_plls[nr_plls] = {
> +static struct __initdata samsung_pll_clock exynos4_plls[nr_plls] = {

And this one... __initdata should come just before the '=', not at the
start, not in the middle and not before the variable.

The reasoning is that with how you have it above, the attributes are
applied to the structure.  You want to apply the attributes to the
declaration instead, so it should come after the variable name.

So, for example:

	struct foo *foo __attribute__((section(".foo"))) = (void *)1;

will place the "foo" variable into a section called ".foo", but:

	struct __attribute__((section(".foo"))) foo *foo = (void *)1;

will place "foo" into the normal .data section.

So, the rule with variable declarations is that the __ specifiers we
have as macros in the kernel always come after the variable name being
declared and nowhere else.  We consider anywhere else buggy.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] clk: exynos4: Make exynos4_plls static
  2013-08-06 20:02 ` Russell King - ARM Linux
@ 2013-08-07  3:21   ` Sachin Kamat
  2013-08-07  3:37     ` Joe Perches
  0 siblings, 1 reply; 8+ messages in thread
From: Sachin Kamat @ 2013-08-07  3:21 UTC (permalink / raw)
  To: linux-arm-kernel

+CC Joe Perches

On 7 August 2013 01:32, Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
> Also note:
>
> On Tue, Aug 06, 2013 at 05:01:13PM +0530, Sachin Kamat wrote:
>> @@ -984,7 +984,7 @@ static __initdata struct of_device_id ext_clk_match[] = {
>
> For the declaration above...
>
>> -struct __initdata samsung_pll_clock exynos4_plls[nr_plls] = {
>> +static struct __initdata samsung_pll_clock exynos4_plls[nr_plls] = {
>
> And this one... __initdata should come just before the '=', not at the
> start, not in the middle and not before the variable.
>
> The reasoning is that with how you have it above, the attributes are
> applied to the structure.  You want to apply the attributes to the
> declaration instead, so it should come after the variable name.
>
> So, for example:
>
>         struct foo *foo __attribute__((section(".foo"))) = (void *)1;
>
> will place the "foo" variable into a section called ".foo", but:
>
>         struct __attribute__((section(".foo"))) foo *foo = (void *)1;
>
> will place "foo" into the normal .data section.
>
> So, the rule with variable declarations is that the __ specifiers we
> have as macros in the kernel always come after the variable name being
> declared and nowhere else.  We consider anywhere else buggy.

Thanks for this useful tip, Russell. There are several instances in
the kernel where these attributes are used at the beginning of the
variable declaration.

Probably it would be useful to add this to checkpatch. Joe?

-- 
With warm regards,
Sachin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] clk: exynos4: Make exynos4_plls static
  2013-08-07  3:21   ` Sachin Kamat
@ 2013-08-07  3:37     ` Joe Perches
  2013-08-07  8:20       ` Russell King - ARM Linux
  0 siblings, 1 reply; 8+ messages in thread
From: Joe Perches @ 2013-08-07  3:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2013-08-07 at 08:51 +0530, Sachin Kamat wrote:
> +CC Joe Perches
> 
> On 7 August 2013 01:32, Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
> > Also note:
> >
> > On Tue, Aug 06, 2013 at 05:01:13PM +0530, Sachin Kamat wrote:
> >> @@ -984,7 +984,7 @@ static __initdata struct of_device_id ext_clk_match[] = {
> >
> > For the declaration above...
> >
> >> -struct __initdata samsung_pll_clock exynos4_plls[nr_plls] = {
> >> +static struct __initdata samsung_pll_clock exynos4_plls[nr_plls] = {
> >
> > And this one... __initdata should come just before the '=', not at the
> > start, not in the middle and not before the variable.
> >
> > The reasoning is that with how you have it above, the attributes are
> > applied to the structure.  You want to apply the attributes to the
> > declaration instead, so it should come after the variable name.
> >
> > So, for example:
> >
> >         struct foo *foo __attribute__((section(".foo"))) = (void *)1;
> >
> > will place the "foo" variable into a section called ".foo", but:
> >
> >         struct __attribute__((section(".foo"))) foo *foo = (void *)1;
> >
> > will place "foo" into the normal .data section.
> >
> > So, the rule with variable declarations is that the __ specifiers we
> > have as macros in the kernel always come after the variable name being
> > declared and nowhere else.  We consider anywhere else buggy.
> 
> Thanks for this useful tip, Russell. There are several instances in
> the kernel where these attributes are used at the beginning of the
> variable declaration.
> 
> Probably it would be useful to add this to checkpatch. Joe?

I think Russell is using the royal "We".

http://en.wikipedia.org/wiki/Majestic_plural

There's no way for checkpatch to look at an __<foo> use
and determine it should be before or after a variable.

__scanf, __printf, __cold, etc are often place before
declarations.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] clk: exynos4: Make exynos4_plls static
  2013-08-07  3:37     ` Joe Perches
@ 2013-08-07  8:20       ` Russell King - ARM Linux
  0 siblings, 0 replies; 8+ messages in thread
From: Russell King - ARM Linux @ 2013-08-07  8:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Aug 06, 2013 at 08:37:28PM -0700, Joe Perches wrote:
> On Wed, 2013-08-07 at 08:51 +0530, Sachin Kamat wrote:
> > +CC Joe Perches
> > 
> > On 7 August 2013 01:32, Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
> > > Also note:
> > >
> > > On Tue, Aug 06, 2013 at 05:01:13PM +0530, Sachin Kamat wrote:
> > >> @@ -984,7 +984,7 @@ static __initdata struct of_device_id ext_clk_match[] = {
> > >
> > > For the declaration above...
> > >
> > >> -struct __initdata samsung_pll_clock exynos4_plls[nr_plls] = {
> > >> +static struct __initdata samsung_pll_clock exynos4_plls[nr_plls] = {
> > >
> > > And this one... __initdata should come just before the '=', not at the
> > > start, not in the middle and not before the variable.
> > >
> > > The reasoning is that with how you have it above, the attributes are
> > > applied to the structure.  You want to apply the attributes to the
> > > declaration instead, so it should come after the variable name.
> > >
> > > So, for example:
> > >
> > >         struct foo *foo __attribute__((section(".foo"))) = (void *)1;
> > >
> > > will place the "foo" variable into a section called ".foo", but:
> > >
> > >         struct __attribute__((section(".foo"))) foo *foo = (void *)1;
> > >
> > > will place "foo" into the normal .data section.
> > >
> > > So, the rule with variable declarations is that the __ specifiers we
> > > have as macros in the kernel always come after the variable name being
> > > declared and nowhere else.  We consider anywhere else buggy.
> > 
> > Thanks for this useful tip, Russell. There are several instances in
> > the kernel where these attributes are used at the beginning of the
> > variable declaration.
> > 
> > Probably it would be useful to add this to checkpatch. Joe?
> 
> I think Russell is using the royal "We".

No I'm not.  There have been many patches to fix errors like the above
in the past.  If it's not considered a bug by the community as a whole,
it damn well should be.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-08-07  8:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-06 11:31 [PATCH 1/3] clk: exynos4: Make exynos4_plls static Sachin Kamat
2013-08-06 11:31 ` [PATCH 2/3] clk: exynos5250: Make exynos5250_plls static Sachin Kamat
2013-08-06 11:31 ` [PATCH 3/3] clk: exynos5420: Make exynos5420_plls static Sachin Kamat
2013-08-06 19:43 ` [PATCH 1/3] clk: exynos4: Make exynos4_plls static Mike Turquette
2013-08-06 20:02 ` Russell King - ARM Linux
2013-08-07  3:21   ` Sachin Kamat
2013-08-07  3:37     ` Joe Perches
2013-08-07  8:20       ` Russell King - ARM Linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).