Skip to contentSkip to conversation

linux: miscellaneous cleanup

PATCH New Jan Beulich 1 participant 1 message May 13, 2009 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux: 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

As usual, written and tested on 2.6.30-rc4 and made apply to the 2.6.18 tree without further testing.

arch/i386/kernel/entry-xen.S +2 -0
@@ -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.
drivers/oprofile/oprofile_files.c +2 -2
@@ -222,7 +222,7 @@ static ssize_t adomain_read(struct file 
 }
 
 
-static struct file_operations active_domain_ops = {
+static const struct file_operations active_domain_ops = {
 	.read		= adomain_read,
 	.write		= adomain_write,
 };
@@ -315,7 +315,7 @@ static ssize_t pdomain_read(struct file 
 	return retval;
 }
 
-static struct file_operations passive_domain_ops = {
+static const struct file_operations passive_domain_ops = {
 	.read		= pdomain_read,
 	.write		= pdomain_write,
 };
drivers/xen/blkback/vbd.c +1 -1
@@ -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)
 {
drivers/xen/blktap/blktap.c +1 -1
@@ -958,7 +958,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;
drivers/xen/core/smpboot.c +1 -5
@@ -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 in
 #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);