Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1284028 > unrolled thread

[PATCH 3/3] clk: tegra-super: Fix sparse warnings for functions not declared as static

Started byJon Hunter <jonathanh@nvidia.com>
First post2015-12-04 18:10 +0100
Last post2015-12-08 11:00 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/3] clk: tegra-super: Fix sparse warnings for functions not declared as static Jon Hunter <jonathanh@nvidia.com> - 2015-12-04 18:10 +0100
    Re: [PATCH 3/3] clk: tegra-super: Fix sparse warnings for functions  not declared as static Rhyland Klein <rklein@nvidia.com> - 2015-12-07 19:00 +0100
      Re: [PATCH 3/3] clk: tegra-super: Fix sparse warnings for functions  not declared as static Jon Hunter <jonathanh@nvidia.com> - 2015-12-08 11:00 +0100

#1284028 — [PATCH 3/3] clk: tegra-super: Fix sparse warnings for functions not declared as static

FromJon Hunter <jonathanh@nvidia.com>
Date2015-12-04 18:10 +0100
Subject[PATCH 3/3] clk: tegra-super: Fix sparse warnings for functions not declared as static
Message-ID<qC21P-5zk-1@gated-at.bofh.it>
Sparse reports the following warnings for structures and functions that
should be declared static:

drivers/clk/tegra/clk-tegra-super-gen4.c:70:35: warning: symbol
 'tegra_super_gen_info_gen4' was not declared. Should it be static?
drivers/clk/tegra/clk-tegra-super-gen4.c:96:35: warning: symbol
 'tegra_super_gen_info_gen5' was not declared. Should it be static?
drivers/clk/tegra/clk-tegra-super-gen4.c:174:13: warning: symbol
 'tegra_super_clk_init' was not declared. Should it be static?

Fix this by making the above static.

Fixes: 88467d220119 ("clk: tegra: Add Super Gen5 Logic")

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/clk/tegra/clk-tegra-super-gen4.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/tegra/clk-tegra-super-gen4.c b/drivers/clk/tegra/clk-tegra-super-gen4.c
index 4559a20e3af6..474de0f0c26d 100644
--- a/drivers/clk/tegra/clk-tegra-super-gen4.c
+++ b/drivers/clk/tegra/clk-tegra-super-gen4.c
@@ -67,7 +67,7 @@ static const char *cclk_lp_parents[] = { "clk_m", "pll_c", "clk_32k", "pll_m",
 					 "pll_p", "pll_p_out4", "unused",
 					 "unused", "pll_x", "pll_x_out0" };
 
-const struct tegra_super_gen_info tegra_super_gen_info_gen4 = {
+static const struct tegra_super_gen_info tegra_super_gen_info_gen4 = {
 	.gen = gen4,
 	.sclk_parents = sclk_parents,
 	.cclk_g_parents = cclk_g_parents,
@@ -93,7 +93,7 @@ static const char *cclk_lp_parents_gen5[] = { "clk_m", "unused", "clk_32k", "unu
 					"unused", "unused", "unused", "unused",
 					"dfllCPU_out" };
 
-const struct tegra_super_gen_info tegra_super_gen_info_gen5 = {
+static const struct tegra_super_gen_info tegra_super_gen_info_gen5 = {
 	.gen = gen5,
 	.sclk_parents = sclk_parents_gen5,
 	.cclk_g_parents = cclk_g_parents_gen5,
@@ -171,7 +171,7 @@ static void __init tegra_sclk_init(void __iomem *clk_base,
 	*dt_clk = clk;
 }
 
-void __init tegra_super_clk_init(void __iomem *clk_base,
+static void __init tegra_super_clk_init(void __iomem *clk_base,
 				void __iomem *pmc_base,
 				struct tegra_clk *tegra_clks,
 				struct tegra_clk_pll_params *params,
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1285828 — Re: [PATCH 3/3] clk: tegra-super: Fix sparse warnings for functions not declared as static

FromRhyland Klein <rklein@nvidia.com>
Date2015-12-07 19:00 +0100
SubjectRe: [PATCH 3/3] clk: tegra-super: Fix sparse warnings for functions not declared as static
Message-ID<qD8eS-7I5-7@gated-at.bofh.it>
In reply to#1284028
On 12/7/2015 10:51 AM, Rhyland Klein wrote:
> On 12/4/2015 12:04 PM, Jon Hunter wrote:
>> Sparse reports the following warnings for structures and functions that
>> should be declared static:
>>
>> drivers/clk/tegra/clk-tegra-super-gen4.c:70:35: warning: symbol
>>  'tegra_super_gen_info_gen4' was not declared. Should it be static?
>> drivers/clk/tegra/clk-tegra-super-gen4.c:96:35: warning: symbol
>>  'tegra_super_gen_info_gen5' was not declared. Should it be static?
>> drivers/clk/tegra/clk-tegra-super-gen4.c:174:13: warning: symbol
>>  'tegra_super_clk_init' was not declared. Should it be static?
>>
>> Fix this by making the above static.
>>
>> Fixes: 88467d220119 ("clk: tegra: Add Super Gen5 Logic")
>>
>> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
>> ---
>>  drivers/clk/tegra/clk-tegra-super-gen4.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
> ...
> 
> Acked-by: Rhyland Klein <rklein@nvidia.com>
> 

Actually, Don't you need to change the function declarations in
drivers/clk/tegra/clk.h for tegra_super_clk_gen[4|5]_init otherwise you
will get mismatches with one being declared static and the other not?

-rhyland

-- 
nvpublic
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1286352 — Re: [PATCH 3/3] clk: tegra-super: Fix sparse warnings for functions not declared as static

FromJon Hunter <jonathanh@nvidia.com>
Date2015-12-08 11:00 +0100
SubjectRe: [PATCH 3/3] clk: tegra-super: Fix sparse warnings for functions not declared as static
Message-ID<qDndU-AW-11@gated-at.bofh.it>
In reply to#1285828
On 07/12/15 17:51, Rhyland Klein wrote:
> On 12/7/2015 10:51 AM, Rhyland Klein wrote:
>> On 12/4/2015 12:04 PM, Jon Hunter wrote:
>>> Sparse reports the following warnings for structures and functions that
>>> should be declared static:
>>>
>>> drivers/clk/tegra/clk-tegra-super-gen4.c:70:35: warning: symbol
>>>  'tegra_super_gen_info_gen4' was not declared. Should it be static?
>>> drivers/clk/tegra/clk-tegra-super-gen4.c:96:35: warning: symbol
>>>  'tegra_super_gen_info_gen5' was not declared. Should it be static?
>>> drivers/clk/tegra/clk-tegra-super-gen4.c:174:13: warning: symbol
>>>  'tegra_super_clk_init' was not declared. Should it be static?
>>>
>>> Fix this by making the above static.
>>>
>>> Fixes: 88467d220119 ("clk: tegra: Add Super Gen5 Logic")
>>>
>>> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
>>> ---
>>>  drivers/clk/tegra/clk-tegra-super-gen4.c | 6 +++---
>>>  1 file changed, 3 insertions(+), 3 deletions(-)
>> ...
>>
>> Acked-by: Rhyland Klein <rklein@nvidia.com>
>>
> 
> Actually, Don't you need to change the function declarations in
> drivers/clk/tegra/clk.h for tegra_super_clk_gen[4|5]_init otherwise you
> will get mismatches with one being declared static and the other not?

So this patch does not touch the functions
tegra_super_clk_gen[4|5]_init() and these should definitely not be
static. This patch just makes the structures
tegra_super_gen_info_gen[4|5] and the function tegra_super_clk_init()
static. None of these are referenced outside clk-tegra-super-gen4.c.

Cheers
Jon
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web