From: John L. <mov...@us...> - 2002-06-06 18:43:51
|
Update of /cvsroot/oprofile/oprofile/module In directory usw-pr-cvs1:/tmp/cvs-serv8419/module Modified Files: compat.c op_dname.c op_init.c op_rtc.c op_util.c op_util.h oprofile.c Log Message: whitespace, use check_range in op_rtc Index: compat.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/module/compat.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- compat.c 6 Jun 2002 16:18:20 -0000 1.11 +++ compat.c 6 Jun 2002 18:43:47 -0000 1.12 @@ -17,7 +17,7 @@ /* note - assumes you only test for NULL, and not * actually care about the return value */ -void *compat_request_region (unsigned long start, unsigned long n, char const * name) +void * compat_request_region (unsigned long start, unsigned long n, char const * name) { if (check_region (start, n) != 0) return NULL; @@ -25,7 +25,7 @@ return (void *) 1; } -int wind_dentries_2_2(struct dentry *dentry) +int wind_dentries_2_2(struct dentry * dentry) { struct dentry * root = current->fs->root; @@ -53,7 +53,7 @@ } /* called with note_lock held */ -uint do_path_hash_2_2(struct dentry *dentry) +uint do_path_hash_2_2(struct dentry * dentry) { /* BKL is already taken */ Index: op_dname.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/module/op_dname.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- op_dname.c 6 Jun 2002 18:25:43 -0000 1.3 +++ op_dname.c 6 Jun 2002 18:43:47 -0000 1.4 @@ -22,13 +22,13 @@ static uint dname_top; -static struct qstr **dname_stack; +static struct qstr ** dname_stack; static char * pool_pos; static char * pool_start; static char * pool_end; static ulong hash_map_open; -static struct op_hash_index *hash_map; +static struct op_hash_index * hash_map; unsigned long is_map_ready(void) { @@ -89,7 +89,7 @@ return 0; } -int oprof_hash_map_mmap(struct file *file, struct vm_area_struct *vma) +int oprof_hash_map_mmap(struct file * file, struct vm_area_struct * vma) { ulong start = (ulong)vma->vm_start; ulong page, pos; @@ -112,10 +112,10 @@ #ifndef NEED_2_2_DENTRIES -int wind_dentries_2_4(struct dentry *dentry, struct vfsmount *vfsmnt, struct dentry *root, struct vfsmount *rootmnt) +int wind_dentries_2_4(struct dentry * dentry, struct vfsmount * vfsmnt, struct dentry * root, struct vfsmount * rootmnt) { - struct dentry *d = dentry; - struct vfsmount *v = vfsmnt; + struct dentry * d = dentry; + struct vfsmount * v = vfsmnt; /* wind the dentries onto the stack pages */ for (;;) { @@ -147,8 +147,8 @@ uint do_path_hash_2_4(struct dentry *dentry, struct vfsmount *vfsmnt) { uint value; - struct vfsmount *rootmnt; - struct dentry *root; + struct vfsmount * rootmnt; + struct dentry * root; read_lock(¤t->fs->lock); rootmnt = mntget(current->fs->rootmnt); @@ -167,9 +167,9 @@ #endif /* NEED_2_2_DENTRIES */ /* called with note_lock held */ -uint do_hash(struct dentry *dentry, struct vfsmount *vfsmnt, struct dentry *root, struct vfsmount *rootmnt) +uint do_hash(struct dentry * dentry, struct vfsmount * vfsmnt, struct dentry * root, struct vfsmount * rootmnt) { - struct qstr *dname; + struct qstr * dname; uint value = -1; uint firsthash; uint incr; Index: op_init.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/module/op_init.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- op_init.c 6 Jun 2002 16:18:22 -0000 1.15 +++ op_init.c 6 Jun 2002 18:43:47 -0000 1.16 @@ -9,6 +9,9 @@ * @author Philippe Elie <ph...@wa...> */ +// FIXME: any point in this file now we don't fiddle +// with -march options ?? + #include "oprofile.h" EXPORT_NO_SYMBOLS; Index: op_rtc.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/module/op_rtc.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- op_rtc.c 6 Jun 2002 16:18:23 -0000 1.17 +++ op_rtc.c 6 Jun 2002 18:43:47 -0000 1.18 @@ -15,6 +15,7 @@ #include <asm/ptrace.h> #include "oprofile.h" +#include "op_util.h" #define RTC_IO_PORTS 2 @@ -25,7 +26,7 @@ /* ---------------- RTC handler ------------------ */ -static void do_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static void do_rtc_interrupt(int irq, void * dev_id, struct pt_regs * regs) { uint cpu = op_cpu_id(); unsigned char intr_flags; @@ -136,11 +137,9 @@ { int target = sysctl.ctr[0].count; - if (target < OP_MIN_RTC_COUNT || target > OP_MAX_RTC_COUNT) { - printk(KERN_ERR "RTC value %d is out of range (%d-%d)\n", - target, OP_MIN_RTC_COUNT, OP_MAX_RTC_COUNT); + if (check_range(target, OP_MIN_RTC_COUNT, OP_MAX_RTC_COUNT, + "RTC value %d is out of range (%d-%d)\n")) return -EINVAL; - } return 0; } Index: op_util.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/module/op_util.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- op_util.c 6 Jun 2002 18:25:43 -0000 1.11 +++ op_util.c 6 Jun 2002 18:43:47 -0000 1.12 @@ -20,7 +20,7 @@ /* Given PGD from the address space's page table, return the kernel * virtual mapping of the physical memory mapped at ADR. */ -static inline unsigned long uvirt_to_kva(pgd_t *pgd, unsigned long adr) +static inline unsigned long uvirt_to_kva(pgd_t * pgd, unsigned long adr) { unsigned long ret = 0UL; pmd_t *pmd; @@ -33,7 +33,7 @@ pte = *ptep; if (pte_present(pte)) { ret = (unsigned long) pte_page_address(pte); - ret |= adr & (PAGE_SIZE-1); + ret |= adr & (PAGE_SIZE - 1); } } } Index: op_util.h =================================================================== RCS file: /cvsroot/oprofile/oprofile/module/op_util.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- op_util.h 6 Jun 2002 18:28:56 -0000 1.2 +++ op_util.h 6 Jun 2002 18:43:47 -0000 1.3 @@ -15,7 +15,7 @@ unsigned long kvirt_to_pa(unsigned long adr); void * rvmalloc(signed long size); void rvfree(void * mem, signed long size); -// returns non-zero on failure +// returns non-zero on failure, inclusive int check_range(int val, int l, int h, char const * msg); #endif /* OP_UTIL_H */ Index: oprofile.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/module/oprofile.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- oprofile.c 6 Jun 2002 18:28:56 -0000 1.58 +++ oprofile.c 6 Jun 2002 18:43:47 -0000 1.59 @@ -71,7 +71,8 @@ data->nextbuf = 0; } -inline static void evict_op_entry(uint cpu, struct _oprof_data * data, const struct op_sample *ops, const struct pt_regs *regs) +inline static void evict_op_entry(uint cpu, struct _oprof_data * data, + struct op_sample const * ops, struct pt_regs const * regs) { memcpy(&data->buffer[data->nextbuf], ops, sizeof(struct op_sample)); next_sample(data); @@ -112,14 +113,14 @@ } } -inline static void fill_op_entry(struct op_sample *ops, struct pt_regs *regs, int ctr) +inline static void fill_op_entry(struct op_sample * ops, struct pt_regs * regs, int ctr) { ops->eip = regs->eip; ops->pid = current->pid; - ops->count = (1U << OP_BITS_COUNT)*ctr + 1; + ops->count = (1U << OP_BITS_COUNT) * ctr + 1; } -void regparm3 op_do_profile(uint cpu, struct pt_regs *regs, int ctr) +void regparm3 op_do_profile(uint cpu, struct pt_regs * regs, int ctr) { struct _oprof_data * data = &oprof_data[cpu]; uint h, i; @@ -181,8 +182,8 @@ oprof_wake_up(&oprof_wait); } -// if holding note_lock -void __oprof_put_note(struct op_note *onote) +/* if holding note_lock */ +void __oprof_put_note(struct op_note * onote) { if (!prof_on) return; @@ -191,16 +192,16 @@ up_and_check_note(); } -void oprof_put_note(struct op_note *onote) +void oprof_put_note(struct op_note * onote) { spin_lock(¬e_lock); __oprof_put_note(onote); spin_unlock(¬e_lock); } -static int oprof_note_read(char *buf, size_t count, loff_t *ppos) +static int oprof_note_read(char * buf, size_t count, loff_t * ppos) { - struct op_note *mybuf; + struct op_note * mybuf; uint num; ssize_t max; @@ -264,7 +265,7 @@ return num; } -static int oprof_read(struct file *file, char *buf, size_t count, loff_t *ppos) +static int oprof_read(struct file * file, char * buf, size_t count, loff_t * ppos) { uint num; ssize_t max; @@ -344,7 +345,7 @@ static int oprof_start(void); static int oprof_stop(void); -static int oprof_open(struct inode *ino, struct file *file) +static int oprof_open(struct inode * ino, struct file * file) { int err; @@ -371,7 +372,7 @@ return err; } -static int oprof_release(struct inode *ino, struct file *file) +static int oprof_release(struct inode * ino, struct file * file) { switch (minor(file->f_dentry->d_inode->i_rdev)) { case 1: return oprof_hash_map_release(); @@ -393,7 +394,7 @@ return oprof_stop(); } -static int oprof_mmap(struct file *file, struct vm_area_struct *vma) +static int oprof_mmap(struct file * file, struct vm_area_struct * vma) { if (minor(file->f_dentry->d_inode->i_rdev) == 1) return oprof_hash_map_mmap(file, vma); @@ -420,7 +421,7 @@ { uint i; ulong hash_size,buf_size; - struct _oprof_data *data; + struct _oprof_data * data; note_buffer = vmalloc(sizeof(struct op_note) * sysctl.note_size); if (!note_buffer) { @@ -637,7 +638,7 @@ MOD_DEC_USE_COUNT; } -static int get_nr_interrupts(ctl_table *table, int write, struct file *filp, void *buffer, size_t *lenp) +static int get_nr_interrupts(ctl_table * table, int write, struct file * filp, void * buffer, size_t * lenp) { uint cpu; int ret = -EINVAL; @@ -660,7 +661,7 @@ return ret; } -int lproc_dointvec(ctl_table *table, int write, struct file *filp, void *buffer, size_t *lenp) +int lproc_dointvec(ctl_table * table, int write, struct file * filp, void * buffer, size_t * lenp) { int err; @@ -671,7 +672,7 @@ return err; } -static void dump_one(struct _oprof_data *data, struct op_sample *ops, uint cpu) +static void dump_one(struct _oprof_data * data, struct op_sample * ops, uint cpu) { if (!ops->count) return; @@ -709,7 +710,7 @@ oprof_wake_up(&oprof_wait); } -static int sysctl_do_dump(ctl_table *table, int write, struct file *filp, void *buffer, size_t *lenp) +static int sysctl_do_dump(ctl_table * table, int write, struct file * filp, void * buffer, size_t * lenp) { int err = -EINVAL; @@ -731,7 +732,7 @@ return err; } -static int sysctl_do_dump_stop(ctl_table *table, int write, struct file *filp, void *buffer, size_t *lenp) +static int sysctl_do_dump_stop(ctl_table * table, int write, struct file * filp, void * buffer, size_t * lenp) { int err = -EINVAL; @@ -786,7 +787,7 @@ {0,}, }; -static struct ctl_table_header *sysctl_header; +static struct ctl_table_header * sysctl_header; /* NOTE: we do *not* support sysctl() syscall */ |