Skip to contentSkip to conversation

x86/mce: Clear a useless global variable in mce.c

PATCH In review Chen Yucong 2 participants 3 messages May 17, 2014 – May 19, 2014 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/mce: Clear a useless global variable in mce.c

This patch is just used to remove a useless global variable mce_entry and relative operations in mce.c.

---
 arch/x86/include/asm/mce.h       |    2 --
 arch/x86/kernel/cpu/mcheck/mce.c |    5 -----
 2 files changed, 7 deletions(-)
arch/x86/include/asm/mce.h +0 -2
index 6e4ce2d..958b90f 100644
@@ -176,8 +176,6 @@ int mce_available(struct cpuinfo_x86 *c);
 DECLARE_PER_CPU(unsigned, mce_exception_count);
 DECLARE_PER_CPU(unsigned, mce_poll_count);
 
-extern atomic_t mce_entry;
-
 typedef DECLARE_BITMAP(mce_banks_t, MAX_NR_BANKS);
 DECLARE_PER_CPU(mce_banks_t, mce_poll_banks);
 
arch/x86/kernel/cpu/mcheck/mce.c +0 -5
index 68317c8..8f520a1 100644
@@ -60,8 +60,6 @@ static DEFINE_MUTEX(mce_chrdev_read_mutex);
 
 #define SPINUNIT 100	/* 100ns */
 
-atomic_t mce_entry;
-
 DEFINE_PER_CPU(unsigned, mce_exception_count);
 
 struct mce_bank *mce_banks __read_mostly;
@@ -1041,8 +1039,6 @@ void do_machine_check(struct pt_regs *regs, long error_code)
 	DECLARE_BITMAP(valid_banks, MAX_NR_BANKS);
 	char *msg = "Unknown";
 
-	atomic_inc(&mce_entry);
-
 	this_cpu_inc(mce_exception_count);
 
 	if (!cfg->banks)
@@ -1172,7 +1168,6 @@ void do_machine_check(struct pt_regs *regs, long error_code)
 		mce_report_event(regs);
 	mce_wrmsrl(MSR_IA32_MCG_STATUS, 0);
 out:
-	atomic_dec(&mce_entry);
 	sync_core();
 }
 EXPORT_SYMBOL_GPL(do_machine_check);
Signature · 1 line
1.7.10.4
maintainer
#1 lore raw
Quoted 2 lines · Chen Yucong

This patch is just used to remove a useless global variable mce_entry and relative operations in mce.c.

Well, I can see from the diff below what you're saying here but a commit message should contain information which explains *why* you're doing the change and not *what* you're doing - that we can see.

IOW, you could instead do some git history research and write in your commit message why this mce_entry got unused and quote commits which removed it, why they removed it and why we want to remove the remains of it now.

In any case, the change itself is correct, I would like to have a commit message which explains why we're removing it.

Thanks.

Signature · 5 lines
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
#2 lore raw
Quoted 13 lines · Borislav Petkov
Quoted 2 lines · Chen Yucong

This patch is just used to remove a useless global variable mce_entry and relative operations in mce.c.

Well, I can see from the diff below what you're saying here but a commit message should contain information which explains *why* you're doing the change and not *what* you're doing - that we can see.

IOW, you could instead do some git history research and write in your commit message why this mce_entry got unused and quote commits which removed it, why they removed it and why we want to remove the remains of it now.

Quoted 5 lines

In any case, the change itself is correct, I would like to have a commit message which explains why we're removing it.

Thanks.

The mce_entry, which was defined as a global variable in mce.c, was used in nmi_watchdog_tick(). But nmi_watchdog_tick() has been discarded in the new generic nmi_watchdog implementation - commit 1fb9d6ad2766. So, of course, there is no need for the mce_entry.

This patch is just used to remove a useless global variable mce_entry and relative operations in mce.c.

---
 arch/x86/include/asm/mce.h       |    2 --
 arch/x86/kernel/cpu/mcheck/mce.c |    5 -----
 2 files changed, 7 deletions(-)
arch/x86/include/asm/mce.h +0 -2
index 6e4ce2d..958b90f 100644
@@ -176,8 +176,6 @@ int mce_available(struct cpuinfo_x86 *c);
 DECLARE_PER_CPU(unsigned, mce_exception_count);
 DECLARE_PER_CPU(unsigned, mce_poll_count);
 
-extern atomic_t mce_entry;
-
 typedef DECLARE_BITMAP(mce_banks_t, MAX_NR_BANKS);
 DECLARE_PER_CPU(mce_banks_t, mce_poll_banks);
 
(quoted diff) +0 -0

b/arch/x86/kernel/cpu/mcheck/mce.c
index 68317c8..8f520a1 100644

arch/x86/kernel/cpu/mcheck/mce.c +0 -2
@@ -60,8 +60,6 @@ static DEFINE_MUTEX(mce_chrdev_read_mutex);
 
 #define SPINUNIT 100	/* 100ns */
 
-atomic_t mce_entry;
-
 DEFINE_PER_CPU(unsigned, mce_exception_count);
 
 struct mce_bank *mce_banks __read_mostly;
@@ -1041,8 +1039,6 @@ void do_machine_check(struct pt_regs *regs, long

error_code)
DECLARE_BITMAP(valid_banks, MAX_NR_BANKS); char *msg = "Unknown";

- atomic_inc(&mce_entry);
-
this_cpu_inc(mce_exception_count);

if (!cfg->banks)
@@ -1172,7 +1168,6 @@ void do_machine_check(struct pt_regs *regs, long error_code)
mce_report_event(regs);
mce_wrmsrl(MSR_IA32_MCG_STATUS, 0);
out:
- atomic_dec(&mce_entry);
sync_core();
}
EXPORT_SYMBOL_GPL(do_machine_check);

Signature · 1 line
1.7.10.4