linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 2/4] x86/mce: Make 4 functions non-static
@ 2019-09-10  8:19 Tony W Wang-oc
  2019-09-10 12:37 ` Borislav Petkov
  0 siblings, 1 reply; 3+ messages in thread
From: Tony W Wang-oc @ 2019-09-10  8:19 UTC (permalink / raw)
  To: tony.luck, Borislav Petkov (bp@alien8.de),
	tglx, mingo, hpa, x86, linux-edac, linux-kernel, yazen.ghannam,
	vishal.l.verma, qiuxu.zhuo
  Cc: David Wang, Cooper Yan(BJ-RD), Qiyuan Wang(BJ-RD), Herry Yang(BJ-RD)

These functions are declared static and cannot be used in others
.c source file. this commit removes the static attribute and adds
the declaration to the header for these functions.

Signed-off-by: Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>
---
 arch/x86/kernel/cpu/mce/intel.c    | 8 ++++----
 arch/x86/kernel/cpu/mce/internal.h | 8 ++++++++
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/cpu/mce/intel.c b/arch/x86/kernel/cpu/mce/intel.c
index 88cd959..eee4b12 100644
--- a/arch/x86/kernel/cpu/mce/intel.c
+++ b/arch/x86/kernel/cpu/mce/intel.c
@@ -423,7 +423,7 @@ void cmci_disable_bank(int bank)
 	raw_spin_unlock_irqrestore(&cmci_discover_lock, flags);
 }
 
-static void intel_init_cmci(void)
+void intel_init_cmci(void)
 {
 	int banks;
 
@@ -442,7 +442,7 @@ static void intel_init_cmci(void)
 	cmci_recheck();
 }
 
-static void intel_init_lmce(void)
+void intel_init_lmce(void)
 {
 	u64 val;
 
@@ -455,7 +455,7 @@ static void intel_init_lmce(void)
 		wrmsrl(MSR_IA32_MCG_EXT_CTL, val | MCG_EXT_CTL_LMCE_EN);
 }
 
-static void intel_clear_lmce(void)
+void intel_clear_lmce(void)
 {
 	u64 val;
 
@@ -467,7 +467,7 @@ static void intel_clear_lmce(void)
 	wrmsrl(MSR_IA32_MCG_EXT_CTL, val);
 }
 
-static void intel_ppin_init(struct cpuinfo_x86 *c)
+void intel_ppin_init(struct cpuinfo_x86 *c)
 {
 	unsigned long long val;
 
diff --git a/arch/x86/kernel/cpu/mce/internal.h b/arch/x86/kernel/cpu/mce/internal.h
index 43031db..55d1f0a 100644
--- a/arch/x86/kernel/cpu/mce/internal.h
+++ b/arch/x86/kernel/cpu/mce/internal.h
@@ -45,11 +45,19 @@ unsigned long cmci_intel_adjust_timer(unsigned long interval);
 bool mce_intel_cmci_poll(void);
 void mce_intel_hcpu_update(unsigned long cpu);
 void cmci_disable_bank(int bank);
+void intel_init_cmci(void);
+void intel_init_lmce(void);
+void intel_clear_lmce(void);
+void intel_ppin_init(struct cpuinfo_x86 *c);
 #else
 # define cmci_intel_adjust_timer mce_adjust_timer_default
 static inline bool mce_intel_cmci_poll(void) { return false; }
 static inline void mce_intel_hcpu_update(unsigned long cpu) { }
 static inline void cmci_disable_bank(int bank) { }
+static inline void intel_init_cmci(void) { }
+static inline void intel_init_lmce(void) { }
+static inline void intel_clear_lmce(void) { }
+static inline void intel_ppin_init(struct cpuinfo_x86 *c) { }
 #endif
 
 void mce_timer_kick(unsigned long interval);
-- 
2.7.4

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

* Re: [PATCH v2 2/4] x86/mce: Make 4 functions non-static
  2019-09-10  8:19 [PATCH v2 2/4] x86/mce: Make 4 functions non-static Tony W Wang-oc
@ 2019-09-10 12:37 ` Borislav Petkov
  2019-09-11 10:11   ` 答复: " Tony W Wang-oc
  0 siblings, 1 reply; 3+ messages in thread
From: Borislav Petkov @ 2019-09-10 12:37 UTC (permalink / raw)
  To: Tony W Wang-oc
  Cc: tony.luck, tglx, mingo, hpa, x86, linux-edac, linux-kernel,
	yazen.ghannam, vishal.l.verma, qiuxu.zhuo, David Wang,
	Cooper Yan(BJ-RD), Qiyuan Wang(BJ-RD), Herry Yang(BJ-RD)

On Tue, Sep 10, 2019 at 08:19:20AM +0000, Tony W Wang-oc wrote:
> These functions are declared static and cannot be used in others
> .c source file. this commit removes the static attribute and adds
> the declaration to the header for these functions.
> 
> Signed-off-by: Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>
> ---
>  arch/x86/kernel/cpu/mce/intel.c    | 8 ++++----
>  arch/x86/kernel/cpu/mce/internal.h | 8 ++++++++
>  2 files changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/mce/intel.c b/arch/x86/kernel/cpu/mce/intel.c
> index 88cd959..eee4b12 100644
> --- a/arch/x86/kernel/cpu/mce/intel.c
> +++ b/arch/x86/kernel/cpu/mce/intel.c
> @@ -423,7 +423,7 @@ void cmci_disable_bank(int bank)
>  	raw_spin_unlock_irqrestore(&cmci_discover_lock, flags);
>  }
>  
> -static void intel_init_cmci(void)
> +void intel_init_cmci(void)
>  {
>  	int banks;
>  
> @@ -442,7 +442,7 @@ static void intel_init_cmci(void)
>  	cmci_recheck();
>  }
>  
> -static void intel_init_lmce(void)
> +void intel_init_lmce(void)
>  {
>  	u64 val;
>  
> @@ -455,7 +455,7 @@ static void intel_init_lmce(void)
>  		wrmsrl(MSR_IA32_MCG_EXT_CTL, val | MCG_EXT_CTL_LMCE_EN);
>  }
>  
> -static void intel_clear_lmce(void)
> +void intel_clear_lmce(void)
>  {
>  	u64 val;
>  
> @@ -467,7 +467,7 @@ static void intel_clear_lmce(void)
>  	wrmsrl(MSR_IA32_MCG_EXT_CTL, val);
>  }
>  
> -static void intel_ppin_init(struct cpuinfo_x86 *c)
> +void intel_ppin_init(struct cpuinfo_x86 *c)

That one doesn't need to get exported.

This can easily be missed because you're exporting them in one patch and
using them in another. Do the exports in the same patch where you use
them for the first time.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

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

* 答复: [PATCH v2 2/4] x86/mce: Make 4 functions non-static
  2019-09-10 12:37 ` Borislav Petkov
@ 2019-09-11 10:11   ` Tony W Wang-oc
  0 siblings, 0 replies; 3+ messages in thread
From: Tony W Wang-oc @ 2019-09-11 10:11 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: tony.luck, tglx, mingo, hpa, x86, linux-edac, linux-kernel,
	yazen.ghannam, vishal.l.verma, qiuxu.zhuo, David Wang,
	Cooper Yan(BJ-RD), Qiyuan Wang(BJ-RD), Herry Yang(BJ-RD)

On Tue, Sep 10, 2019, Borislav Petkov wrote:
>On Tue, Sep 10, 2019 at 08:19:20AM +0000, Tony W Wang-oc wrote:
>> These functions are declared static and cannot be used in others
>> .c source file. this commit removes the static attribute and adds
>> the declaration to the header for these functions.
>>
>> Signed-off-by: Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>
>> ---
>>  arch/x86/kernel/cpu/mce/intel.c    | 8 ++++----
>>  arch/x86/kernel/cpu/mce/internal.h | 8 ++++++++
>>  2 files changed, 12 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/x86/kernel/cpu/mce/intel.c b/arch/x86/kernel/cpu/mce/intel.c
>> index 88cd959..eee4b12 100644
>> --- a/arch/x86/kernel/cpu/mce/intel.c
>> +++ b/arch/x86/kernel/cpu/mce/intel.c
>> @@ -423,7 +423,7 @@ void cmci_disable_bank(int bank)
>>  	raw_spin_unlock_irqrestore(&cmci_discover_lock, flags);
>>  }
>>
>> -static void intel_init_cmci(void)
>> +void intel_init_cmci(void)
>>  {
>>  	int banks;
>>
>> @@ -442,7 +442,7 @@ static void intel_init_cmci(void)
>>  	cmci_recheck();
>>  }
>>
>> -static void intel_init_lmce(void)
>> +void intel_init_lmce(void)
>>  {
>>  	u64 val;
>>
>> @@ -455,7 +455,7 @@ static void intel_init_lmce(void)
>>  		wrmsrl(MSR_IA32_MCG_EXT_CTL, val | MCG_EXT_CTL_LMCE_EN);
>>  }
>>
>> -static void intel_clear_lmce(void)
>> +void intel_clear_lmce(void)
>>  {
>>  	u64 val;
>>
>> @@ -467,7 +467,7 @@ static void intel_clear_lmce(void)
>>  	wrmsrl(MSR_IA32_MCG_EXT_CTL, val);
>>  }
>>
>> -static void intel_ppin_init(struct cpuinfo_x86 *c)
>> +void intel_ppin_init(struct cpuinfo_x86 *c)
>
>That one doesn't need to get exported.
>
>This can easily be missed because you're exporting them in one patch and
>using them in another. Do the exports in the same patch where you use
>them for the first time.

Got it, will fix this in v3.

Sincerely
TonyWWang-oc


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

end of thread, other threads:[~2019-09-11 10:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-10  8:19 [PATCH v2 2/4] x86/mce: Make 4 functions non-static Tony W Wang-oc
2019-09-10 12:37 ` Borislav Petkov
2019-09-11 10:11   ` 答复: " Tony W Wang-oc

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).