Skip to content

Commit cf3f335

Browse files
committed
Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86: Use "do { } while(0)" for empty lock_cmos()/unlock_cmos() macros x86: Use "do { } while(0)" for empty flush_tlb_fix_spurious_fault() macro x86, CPU: Drop superfluous get_cpu_cap() prototype arch/x86/mm/pageattr.c: Quiet sparse noise; local functions should be static arch/x86/kernel/ptrace.c: Quiet sparse noise x86: Use kmemdup() in copy_thread(), rather than duplicating its implementation x86: Replace the EVT_TO_HPET_DEV() macro with an inline function
2 parents 69734b6 + 1affc46 commit cf3f335

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

arch/x86/include/asm/mc146818rtc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ static inline unsigned char current_lock_cmos_reg(void)
8181
#else
8282
#define lock_cmos_prefix(reg) do {} while (0)
8383
#define lock_cmos_suffix(reg) do {} while (0)
84-
#define lock_cmos(reg)
85-
#define unlock_cmos()
84+
#define lock_cmos(reg) do { } while (0)
85+
#define unlock_cmos() do { } while (0)
8686
#define do_i_have_lock_cmos() 0
8787
#define current_lock_cmos_reg() 0
8888
#endif

arch/x86/include/asm/pgtable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm,
703703
pte_update(mm, addr, ptep);
704704
}
705705

706-
#define flush_tlb_fix_spurious_fault(vma, address)
706+
#define flush_tlb_fix_spurious_fault(vma, address) do { } while (0)
707707

708708
#define mk_pmd(page, pgprot) pfn_pmd(page_to_pfn(page), (pgprot))
709709

arch/x86/kernel/cpu/cpu.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#ifndef ARCH_X86_CPU_H
2-
32
#define ARCH_X86_CPU_H
43

54
struct cpu_model_info {
@@ -35,6 +34,4 @@ extern const struct cpu_dev *const __x86_cpu_dev_start[],
3534

3635
extern void get_cpu_cap(struct cpuinfo_x86 *c);
3736
extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c);
38-
extern void get_cpu_cap(struct cpuinfo_x86 *c);
39-
40-
#endif
37+
#endif /* ARCH_X86_CPU_H */

arch/x86/kernel/hpet.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
#define HPET_MIN_CYCLES 128
3333
#define HPET_MIN_PROG_DELTA (HPET_MIN_CYCLES + (HPET_MIN_CYCLES >> 1))
3434

35-
#define EVT_TO_HPET_DEV(evt) container_of(evt, struct hpet_dev, evt)
36-
3735
/*
3836
* HPET address is set in acpi/boot.c, when an ACPI entry exists
3937
*/
@@ -55,6 +53,11 @@ struct hpet_dev {
5553
char name[10];
5654
};
5755

56+
inline struct hpet_dev *EVT_TO_HPET_DEV(struct clock_event_device *evtdev)
57+
{
58+
return container_of(evtdev, struct hpet_dev, evt);
59+
}
60+
5861
inline unsigned int hpet_readl(unsigned int a)
5962
{
6063
return readl(hpet_virt_address + a);

arch/x86/kernel/process_64.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,13 +299,12 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
299299
memset(p->thread.ptrace_bps, 0, sizeof(p->thread.ptrace_bps));
300300

301301
if (unlikely(test_tsk_thread_flag(me, TIF_IO_BITMAP))) {
302-
p->thread.io_bitmap_ptr = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL);
302+
p->thread.io_bitmap_ptr = kmemdup(me->thread.io_bitmap_ptr,
303+
IO_BITMAP_BYTES, GFP_KERNEL);
303304
if (!p->thread.io_bitmap_ptr) {
304305
p->thread.io_bitmap_max = 0;
305306
return -ENOMEM;
306307
}
307-
memcpy(p->thread.io_bitmap_ptr, me->thread.io_bitmap_ptr,
308-
IO_BITMAP_BYTES);
309308
set_tsk_thread_flag(p, TIF_IO_BITMAP);
310309
}
311310

arch/x86/kernel/ptrace.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,8 @@ static int ptrace_set_breakpoint_addr(struct task_struct *tsk, int nr,
749749
/*
750750
* Handle PTRACE_POKEUSR calls for the debug register area.
751751
*/
752-
int ptrace_set_debugreg(struct task_struct *tsk, int n, unsigned long val)
752+
static int ptrace_set_debugreg(struct task_struct *tsk, int n,
753+
unsigned long val)
753754
{
754755
struct thread_struct *thread = &(tsk->thread);
755756
int rc = 0;

arch/x86/mm/pageattr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ int set_memory_uc(unsigned long addr, int numpages)
998998
}
999999
EXPORT_SYMBOL(set_memory_uc);
10001000

1001-
int _set_memory_array(unsigned long *addr, int addrinarray,
1001+
static int _set_memory_array(unsigned long *addr, int addrinarray,
10021002
unsigned long new_type)
10031003
{
10041004
int i, j;

0 commit comments

Comments
 (0)