From: Keir Fraser Date: Thu, 14 May 2009 09:08:10 +0000 (+0100) Subject: xen: miscellaneous cleanup X-Git-Tag: xen-3.4.0~2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c40e156b9bb5d37c195d5da62bcc023a75b9a36a;p=legacy%2Flinux-2.6.18-xen.git xen: miscellaneous cleanup - add two missing unwind annotations - mark remaining struct file_operations instances const - use get_capacity() instead of raw access to the capacity field - use assert_spin_locked() instead of BUG_ON(!spin_is_locked()) - use clear_tsk_thread_flag() instead of clear_ti_thread_flag() - remove dead variable cpu_state Signed-off-by: Jan Beulich --- diff --git a/arch/i386/kernel/entry-xen.S b/arch/i386/kernel/entry-xen.S index c2e39023..438df1e0 100644 --- a/arch/i386/kernel/entry-xen.S +++ b/arch/i386/kernel/entry-xen.S @@ -388,8 +388,10 @@ ENTRY(sysenter_entry_pv) movl %ebp,12(%esp) movl $__USER_CS,4(%esp) addl $4,%esp + CFI_ADJUST_CFA_OFFSET -4 /* +5*4 is SS:ESP,EFLAGS,CS:EIP. +8 is esp0 setting. */ pushl (TI_sysenter_return-THREAD_SIZE+8+4*4)(%esp) + CFI_ADJUST_CFA_OFFSET 4 /* * Load the potential sixth argument from user stack. * Careful about security. diff --git a/drivers/oprofile/oprofile_files.c b/drivers/oprofile/oprofile_files.c index 67f42e11..67194204 100644 --- a/drivers/oprofile/oprofile_files.c +++ b/drivers/oprofile/oprofile_files.c @@ -215,7 +215,7 @@ static ssize_t adomain_read(struct file * file, char __user * buf, } -static struct file_operations active_domain_ops = { +static const struct file_operations active_domain_ops = { .read = adomain_read, .write = adomain_write, }; @@ -308,7 +308,7 @@ static ssize_t pdomain_read(struct file * file, char __user * buf, return retval; } -static struct file_operations passive_domain_ops = { +static const struct file_operations passive_domain_ops = { .read = pdomain_read, .write = pdomain_write, }; diff --git a/drivers/xen/blkback/vbd.c b/drivers/xen/blkback/vbd.c index 2594419f..3876c027 100644 --- a/drivers/xen/blkback/vbd.c +++ b/drivers/xen/blkback/vbd.c @@ -33,7 +33,7 @@ #include "common.h" #define vbd_sz(_v) ((_v)->bdev->bd_part ? \ - (_v)->bdev->bd_part->nr_sects : (_v)->bdev->bd_disk->capacity) + (_v)->bdev->bd_part->nr_sects : get_capacity((_v)->bdev->bd_disk)) unsigned long long vbd_size(struct vbd *vbd) { diff --git a/drivers/xen/blktap/blktap.c b/drivers/xen/blktap/blktap.c index f24a000f..f6a33eb2 100644 --- a/drivers/xen/blktap/blktap.c +++ b/drivers/xen/blktap/blktap.c @@ -957,7 +957,7 @@ static int req_increase(void) static void mmap_req_del(int mmap) { - BUG_ON(!spin_is_locked(&pending_free_lock)); + assert_spin_locked(&pending_free_lock); kfree(pending_reqs[mmap]); pending_reqs[mmap] = NULL; diff --git a/drivers/xen/core/smpboot.c b/drivers/xen/core/smpboot.c index deb5f991..80bd1bb2 100644 --- a/drivers/xen/core/smpboot.c +++ b/drivers/xen/core/smpboot.c @@ -48,10 +48,6 @@ cpumask_t cpu_initialized_map; struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned; EXPORT_SYMBOL(cpu_data); -#ifdef CONFIG_HOTPLUG_CPU -DEFINE_PER_CPU(int, cpu_state) = { 0 }; -#endif - static DEFINE_PER_CPU(int, resched_irq); static DEFINE_PER_CPU(int, callfunc_irq); static char resched_name[NR_CPUS][15]; @@ -345,7 +341,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) #ifdef __x86_64__ cpu_pda(cpu)->pcurrent = idle; cpu_pda(cpu)->cpunumber = cpu; - clear_ti_thread_flag(idle->thread_info, TIF_FORK); + clear_tsk_thread_flag(idle, TIF_FORK); #endif irq_ctx_init(cpu);