From: "Jan Beulich" Subject: [PATCH] linux: miscellaneous cleanup Date: Wed, 13 May 2009 15:31:18 +0100 Message-ID: <4A0AF5D60200007800000C09@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org - 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 As usual, written and tested on 2.6.30-rc4 and made apply to the 2.6.18 tree without further testing. Signed-off-by: Jan Beulich --- head-2009-05-04.orig/arch/i386/kernel/entry-xen.S 2009-05-13 = 14:06:24.000000000 +0200 +++ head-2009-05-04/arch/i386/kernel/entry-xen.S 2009-05-13 = 14:11:53.000000000 +0200 @@ -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. --- head-2009-05-04.orig/drivers/oprofile/oprofile_files.c 2009-05-13 = 14:06:24.000000000 +0200 +++ head-2009-05-04/drivers/oprofile/oprofile_files.c 2009-05-04 = 11:04:43.000000000 +0200 @@ -222,7 +222,7 @@ static ssize_t adomain_read(struct file=20 } =20 =20 -static struct file_operations active_domain_ops =3D { +static const struct file_operations active_domain_ops =3D { .read =3D adomain_read, .write =3D adomain_write, }; @@ -315,7 +315,7 @@ static ssize_t pdomain_read(struct file=20 return retval; } =20 -static struct file_operations passive_domain_ops =3D { +static const struct file_operations passive_domain_ops =3D { .read =3D pdomain_read, .write =3D pdomain_write, }; --- head-2009-05-04.orig/drivers/xen/blkback/vbd.c 2009-05-13 = 14:06:24.000000000 +0200 +++ head-2009-05-04/drivers/xen/blkback/vbd.c 2009-05-04 11:04:43.0000000= 00 +0200 @@ -33,7 +33,7 @@ #include "common.h" =20 #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)) =20 unsigned long long vbd_size(struct vbd *vbd) { --- head-2009-05-04.orig/drivers/xen/blktap/blktap.c 2009-05-13 = 14:06:24.000000000 +0200 +++ head-2009-05-04/drivers/xen/blktap/blktap.c 2009-05-04 11:04:43.0000000= 00 +0200 @@ -958,7 +958,7 @@ static int req_increase(void) =20 static void mmap_req_del(int mmap) { - BUG_ON(!spin_is_locked(&pending_free_lock)); + assert_spin_locked(&pending_free_lock); =20 kfree(pending_reqs[mmap]); pending_reqs[mmap] =3D NULL; --- head-2009-05-04.orig/drivers/xen/core/smpboot.c 2009-05-13 = 14:06:24.000000000 +0200 +++ head-2009-05-04/drivers/xen/core/smpboot.c 2009-05-04 11:04:43.0000000= 00 +0200 @@ -48,10 +48,6 @@ cpumask_t cpu_initialized_map; struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned; EXPORT_SYMBOL(cpu_data); =20 -#ifdef CONFIG_HOTPLUG_CPU -DEFINE_PER_CPU(int, cpu_state) =3D { 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 in #ifdef __x86_64__ cpu_pda(cpu)->pcurrent =3D idle; cpu_pda(cpu)->cpunumber =3D cpu; - clear_ti_thread_flag(idle->thread_info, TIF_FORK); + clear_tsk_thread_flag(idle, TIF_FORK); #endif =20 irq_ctx_init(cpu);