diff options
author | Len Brown <len.brown@intel.com> | 2004-08-09 04:00:52 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2004-08-09 04:00:52 -0400 |
commit | 493b9f604cafbe9139d0e0c19ecc1d7926568bd6 (patch) | |
tree | 55fdc465adeece8217f731e9cdfbc592e0ece335 /arch | |
parent | 98102e736027f674ba55c959ee47df3877a4aa86 (diff) | |
parent | 4ab06c9ab4babac5cea0ff25b399c216ac166df1 (diff) | |
download | history-493b9f604cafbe9139d0e0c19ecc1d7926568bd6.tar.gz |
Merge intel.com:/home/lenb/bk/linux-2.6.8
into intel.com:/home/lenb/src/linux-acpi-test-2.6.8
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/kernel/io.c | 14 | ||||
-rw-r--r-- | arch/arm/nwfpe/fpa11.h | 2 | ||||
-rw-r--r-- | arch/arm/nwfpe/fpa11_cpdt.c | 48 | ||||
-rw-r--r-- | arch/arm/nwfpe/fpmodule.c | 2 | ||||
-rw-r--r-- | arch/arm/nwfpe/fpmodule.inl | 33 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/mtrr/if.c | 3 | ||||
-rw-r--r-- | arch/ia64/kernel/perfmon.c | 13 | ||||
-rw-r--r-- | arch/ppc/8xx_io/cs4218_tdm.c | 6 | ||||
-rw-r--r-- | arch/ppc/kernel/ppc_htab.c | 8 | ||||
-rw-r--r-- | arch/ppc64/kernel/rtc.c | 20 | ||||
-rw-r--r-- | arch/s390/appldata/appldata_base.c | 22 | ||||
-rw-r--r-- | arch/s390/mm/cmm.c | 12 | ||||
-rw-r--r-- | arch/um/drivers/harddog_kern.c | 6 |
13 files changed, 78 insertions, 111 deletions
diff --git a/arch/arm/kernel/io.c b/arch/arm/kernel/io.c index 34d6a867e36845..9e8868bc55d452 100644 --- a/arch/arm/kernel/io.c +++ b/arch/arm/kernel/io.c @@ -7,12 +7,13 @@ * Copy data from IO memory space to "real" memory space. * This needs to be optimized. */ -void _memcpy_fromio(void * to, unsigned long from, size_t count) +void _memcpy_fromio(void *to, unsigned long from, size_t count) { + unsigned char *t = to; while (count) { count--; - *(char *) to = readb(from); - ((char *) to)++; + *t = readb(from); + t++; from++; } } @@ -21,12 +22,13 @@ void _memcpy_fromio(void * to, unsigned long from, size_t count) * Copy data from "real" memory space to IO memory space. * This needs to be optimized. */ -void _memcpy_toio(unsigned long to, const void * from, size_t count) +void _memcpy_toio(unsigned long to, const void *from, size_t count) { + const unsigned char *f = from; while (count) { count--; - writeb(*(char *) from, to); - ((char *) from)++; + writeb(*f, to); + f++; to++; } } diff --git a/arch/arm/nwfpe/fpa11.h b/arch/arm/nwfpe/fpa11.h index c3f14c7aa9c978..45cc65426a223a 100644 --- a/arch/arm/nwfpe/fpa11.h +++ b/arch/arm/nwfpe/fpa11.h @@ -29,7 +29,7 @@ * stack+task struct. Use the same method as 'current' uses to * reach them. */ -register unsigned int *user_registers asm("sl"); +register unsigned long *user_registers asm("sl"); #define GET_USERREG() (user_registers) diff --git a/arch/arm/nwfpe/fpa11_cpdt.c b/arch/arm/nwfpe/fpa11_cpdt.c index 59e3197d6d5450..2ad457558681dd 100644 --- a/arch/arm/nwfpe/fpa11_cpdt.c +++ b/arch/arm/nwfpe/fpa11_cpdt.c @@ -29,14 +29,14 @@ #include <asm/uaccess.h> -static inline void loadSingle(const unsigned int Fn, const unsigned int *pMem) +static inline void loadSingle(const unsigned int Fn, const unsigned int __user *pMem) { FPA11 *fpa11 = GET_FPA11(); fpa11->fType[Fn] = typeSingle; get_user(fpa11->fpreg[Fn].fSingle, pMem); } -static inline void loadDouble(const unsigned int Fn, const unsigned int *pMem) +static inline void loadDouble(const unsigned int Fn, const unsigned int __user *pMem) { FPA11 *fpa11 = GET_FPA11(); unsigned int *p; @@ -47,7 +47,7 @@ static inline void loadDouble(const unsigned int Fn, const unsigned int *pMem) } #ifdef CONFIG_FPE_NWFPE_XP -static inline void loadExtended(const unsigned int Fn, const unsigned int *pMem) +static inline void loadExtended(const unsigned int Fn, const unsigned int __user *pMem) { FPA11 *fpa11 = GET_FPA11(); unsigned int *p; @@ -59,7 +59,7 @@ static inline void loadExtended(const unsigned int Fn, const unsigned int *pMem) } #endif -static inline void loadMultiple(const unsigned int Fn, const unsigned int *pMem) +static inline void loadMultiple(const unsigned int Fn, const unsigned int __user *pMem) { FPA11 *fpa11 = GET_FPA11(); register unsigned int *p; @@ -91,7 +91,7 @@ static inline void loadMultiple(const unsigned int Fn, const unsigned int *pMem) } } -static inline void storeSingle(const unsigned int Fn, unsigned int *pMem) +static inline void storeSingle(const unsigned int Fn, unsigned int __user *pMem) { FPA11 *fpa11 = GET_FPA11(); union { @@ -117,7 +117,7 @@ static inline void storeSingle(const unsigned int Fn, unsigned int *pMem) put_user(val.i[0], pMem); } -static inline void storeDouble(const unsigned int Fn, unsigned int *pMem) +static inline void storeDouble(const unsigned int Fn, unsigned int __user *pMem) { FPA11 *fpa11 = GET_FPA11(); union { @@ -145,7 +145,7 @@ static inline void storeDouble(const unsigned int Fn, unsigned int *pMem) } #ifdef CONFIG_FPE_NWFPE_XP -static inline void storeExtended(const unsigned int Fn, unsigned int *pMem) +static inline void storeExtended(const unsigned int Fn, unsigned int __user *pMem) { FPA11 *fpa11 = GET_FPA11(); union { @@ -172,7 +172,7 @@ static inline void storeExtended(const unsigned int Fn, unsigned int *pMem) } #endif -static inline void storeMultiple(const unsigned int Fn, unsigned int *pMem) +static inline void storeMultiple(const unsigned int Fn, unsigned int __user *pMem) { FPA11 *fpa11 = GET_FPA11(); register unsigned int nType, *p; @@ -204,10 +204,10 @@ static inline void storeMultiple(const unsigned int Fn, unsigned int *pMem) unsigned int PerformLDF(const unsigned int opcode) { - unsigned int *pBase, *pAddress, *pFinal, nRc = 1, - write_back = WRITE_BACK(opcode); + unsigned int __user *pBase, *pAddress, *pFinal; + unsigned int nRc = 1, write_back = WRITE_BACK(opcode); - pBase = (unsigned int *) readRegister(getRn(opcode)); + pBase = (unsigned int __user *) readRegister(getRn(opcode)); if (REG_PC == getRn(opcode)) { pBase += 2; write_back = 0; @@ -241,18 +241,18 @@ unsigned int PerformLDF(const unsigned int opcode) } if (write_back) - writeRegister(getRn(opcode), (unsigned int) pFinal); + writeRegister(getRn(opcode), (unsigned long) pFinal); return nRc; } unsigned int PerformSTF(const unsigned int opcode) { - unsigned int *pBase, *pAddress, *pFinal, nRc = 1, - write_back = WRITE_BACK(opcode); + unsigned int __user *pBase, *pAddress, *pFinal; + unsigned int nRc = 1, write_back = WRITE_BACK(opcode); SetRoundingMode(ROUND_TO_NEAREST); - pBase = (unsigned int *) readRegister(getRn(opcode)); + pBase = (unsigned int __user *) readRegister(getRn(opcode)); if (REG_PC == getRn(opcode)) { pBase += 2; write_back = 0; @@ -286,16 +286,16 @@ unsigned int PerformSTF(const unsigned int opcode) } if (write_back) - writeRegister(getRn(opcode), (unsigned int) pFinal); + writeRegister(getRn(opcode), (unsigned long) pFinal); return nRc; } unsigned int PerformLFM(const unsigned int opcode) { - unsigned int i, Fd, *pBase, *pAddress, *pFinal, - write_back = WRITE_BACK(opcode); + unsigned int __user *pBase, *pAddress, *pFinal; + unsigned int i, Fd, write_back = WRITE_BACK(opcode); - pBase = (unsigned int *) readRegister(getRn(opcode)); + pBase = (unsigned int __user *) readRegister(getRn(opcode)); if (REG_PC == getRn(opcode)) { pBase += 2; write_back = 0; @@ -322,16 +322,16 @@ unsigned int PerformLFM(const unsigned int opcode) } if (write_back) - writeRegister(getRn(opcode), (unsigned int) pFinal); + writeRegister(getRn(opcode), (unsigned long) pFinal); return 1; } unsigned int PerformSFM(const unsigned int opcode) { - unsigned int i, Fd, *pBase, *pAddress, *pFinal, - write_back = WRITE_BACK(opcode); + unsigned int __user *pBase, *pAddress, *pFinal; + unsigned int i, Fd, write_back = WRITE_BACK(opcode); - pBase = (unsigned int *) readRegister(getRn(opcode)); + pBase = (unsigned int __user *) readRegister(getRn(opcode)); if (REG_PC == getRn(opcode)) { pBase += 2; write_back = 0; @@ -358,7 +358,7 @@ unsigned int PerformSFM(const unsigned int opcode) } if (write_back) - writeRegister(getRn(opcode), (unsigned int) pFinal); + writeRegister(getRn(opcode), (unsigned long) pFinal); return 1; } diff --git a/arch/arm/nwfpe/fpmodule.c b/arch/arm/nwfpe/fpmodule.c index 7c417158d6b25a..a806fea5c3ed6c 100644 --- a/arch/arm/nwfpe/fpmodule.c +++ b/arch/arm/nwfpe/fpmodule.c @@ -131,7 +131,7 @@ void float_raise(signed char flags) #ifdef CONFIG_DEBUG_USER printk(KERN_DEBUG - "NWFPE: %s[%d] takes exception %08x at %p from %08x\n", + "NWFPE: %s[%d] takes exception %08x at %p from %08lx\n", current->comm, current->pid, flags, __builtin_return_address(0), GET_USERREG()[15]); #endif diff --git a/arch/arm/nwfpe/fpmodule.inl b/arch/arm/nwfpe/fpmodule.inl index 119fb3f48ec079..e5f59e9a302227 100644 --- a/arch/arm/nwfpe/fpmodule.inl +++ b/arch/arm/nwfpe/fpmodule.inl @@ -19,8 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -extern __inline__ -unsigned int readRegister(const unsigned int nReg) +static inline unsigned long readRegister(const unsigned int nReg) { /* Note: The CPU thinks it has dealt with the current instruction. As a result the program counter has been advanced to the next @@ -29,34 +28,31 @@ unsigned int readRegister(const unsigned int nReg) for this in this routine. LDF/STF instructions with Rn = PC depend on the PC being correct, as they use PC+8 in their address calculations. */ - unsigned int *userRegisters = GET_USERREG(); + unsigned long *userRegisters = GET_USERREG(); unsigned int val = userRegisters[nReg]; if (REG_PC == nReg) val -= 4; return val; } -extern __inline__ -void writeRegister(const unsigned int nReg, const unsigned int val) +static inline void +writeRegister(const unsigned int nReg, const unsigned long val) { - unsigned int *userRegisters = GET_USERREG(); + unsigned long *userRegisters = GET_USERREG(); userRegisters[nReg] = val; } -extern __inline__ -unsigned int readCPSR(void) +static inline unsigned long readCPSR(void) { return (readRegister(REG_CPSR)); } -extern __inline__ -void writeCPSR(const unsigned int val) +static inline void writeCPSR(const unsigned long val) { writeRegister(REG_CPSR, val); } -extern __inline__ -unsigned int readConditionCodes(void) +static inline unsigned long readConditionCodes(void) { #ifdef __FPEM_TEST__ return (0); @@ -65,11 +61,10 @@ unsigned int readConditionCodes(void) #endif } -extern __inline__ -void writeConditionCodes(const unsigned int val) +static inline void writeConditionCodes(const unsigned long val) { - unsigned int *userRegisters = GET_USERREG(); - unsigned int rval; + unsigned long *userRegisters = GET_USERREG(); + unsigned long rval; /* * Operate directly on userRegisters since * the CPSR may be the PC register itself. @@ -77,9 +72,3 @@ void writeConditionCodes(const unsigned int val) rval = userRegisters[REG_CPSR] & ~CC_MASK; userRegisters[REG_CPSR] = rval | (val & CC_MASK); } - -extern __inline__ -unsigned int readMemoryInt(unsigned int *pMem) -{ - return *pMem; -} diff --git a/arch/i386/kernel/cpu/mtrr/if.c b/arch/i386/kernel/cpu/mtrr/if.c index 4f53d52de5fcfc..0946844217b9cc 100644 --- a/arch/i386/kernel/cpu/mtrr/if.c +++ b/arch/i386/kernel/cpu/mtrr/if.c @@ -101,9 +101,6 @@ mtrr_write(struct file *file, const char __user *buf, size_t len, loff_t * ppos) if (!capable(CAP_SYS_ADMIN)) return -EPERM; - /* Can't seek (pwrite) on this device */ - if (ppos != &file->f_pos) - return -ESPIPE; memset(line, 0, LINE_SIZE); if (len > LINE_SIZE) len = LINE_SIZE; diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index 0455e6859dbc7a..3a6ebc7368b77d 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c @@ -1512,13 +1512,6 @@ exit_pfm_fs(void) mntput(pfmfs_mnt); } -static loff_t -pfm_lseek(struct file *file, loff_t offset, int whence) -{ - DPRINT(("pfm_lseek called\n")); - return -ESPIPE; -} - static ssize_t pfm_read(struct file *filp, char *buf, size_t size, loff_t *ppos) { @@ -1545,10 +1538,6 @@ pfm_read(struct file *filp, char *buf, size_t size, loff_t *ppos) DPRINT(("message is too small ctx=%p (>=%ld)\n", ctx, sizeof(pfm_msg_t))); return -EINVAL; } - /* - * seeks are not allowed on message queues - */ - if (ppos != &filp->f_pos) return -ESPIPE; PROTECT_CTX(ctx, flags); @@ -2141,7 +2130,7 @@ pfm_no_open(struct inode *irrelevant, struct file *dontcare) static struct file_operations pfm_file_ops = { - .llseek = pfm_lseek, + .llseek = no_llseek, .read = pfm_read, .write = pfm_write, .poll = pfm_poll, diff --git a/arch/ppc/8xx_io/cs4218_tdm.c b/arch/ppc/8xx_io/cs4218_tdm.c index 7a5dd9ca3668bd..514e7de4055b25 100644 --- a/arch/ppc/8xx_io/cs4218_tdm.c +++ b/arch/ppc/8xx_io/cs4218_tdm.c @@ -1619,7 +1619,7 @@ static ssize_t sound_copy_translate_read(const u_char *userPtr, static int mixer_open(struct inode *inode, struct file *file) { mixer.busy = 1; - return 0; + return nonseekable_open(inode, file); } @@ -2105,7 +2105,7 @@ static int sq_open(struct inode *inode, struct file *file) sound_set_format(AFMT_MU_LAW); } - return 0; + return nonseekable_open(inode, file); err_out_nobusy: if (file->f_mode & FMODE_WRITE) { @@ -2404,7 +2404,7 @@ static int state_open(struct inode *inode, struct file *file) len += sprintf(buffer+len, "\tsq.active = %d sq.syncing = %d\n", sq.active, sq.syncing); state.len = len; - return 0; + return nonseekable_open(inode, file); } diff --git a/arch/ppc/kernel/ppc_htab.c b/arch/ppc/kernel/ppc_htab.c index 29ff57bbab5486..91592c03ea8bb1 100644 --- a/arch/ppc/kernel/ppc_htab.c +++ b/arch/ppc/kernel/ppc_htab.c @@ -35,7 +35,7 @@ static int ppc_htab_show(struct seq_file *m, void *v); static ssize_t ppc_htab_write(struct file * file, const char __user * buffer, size_t count, loff_t *ppos); int proc_dol2crvec(ctl_table *table, int write, struct file *filp, - void __user *buffer, size_t *lenp); + void __user *buffer, size_t *lenp, loff_t *ppos); extern PTE *Hash, *Hash_end; extern unsigned long Hash_size, Hash_mask; @@ -320,7 +320,7 @@ static ssize_t ppc_htab_write(struct file * file, const char __user * ubuffer, } int proc_dol2crvec(ctl_table *table, int write, struct file *filp, - void __user *buffer_arg, size_t *lenp) + void __user *buffer_arg, size_t *lenp, loff_t *ppos) { int vleft, first=1, len, left, val; char __user *buffer = (char __user *) buffer_arg; @@ -344,7 +344,7 @@ int proc_dol2crvec(ctl_table *table, int write, struct file *filp, if (!(cur_cpu_spec[0]->cpu_features & CPU_FTR_L2CR)) return -EFAULT; - if ( /*!table->maxlen ||*/ (filp->f_pos && !write)) { + if ( /*!table->maxlen ||*/ (*ppos && !write)) { *lenp = 0; return 0; } @@ -435,6 +435,6 @@ int proc_dol2crvec(ctl_table *table, int write, struct file *filp, if (write && first) return -EINVAL; *lenp -= left; - filp->f_pos += *lenp; + *ppos += *lenp; return 0; } diff --git a/arch/ppc64/kernel/rtc.c b/arch/ppc64/kernel/rtc.c index 2f92d958fbb405..7bf41f3cab904b 100644 --- a/arch/ppc64/kernel/rtc.c +++ b/arch/ppc64/kernel/rtc.c @@ -56,9 +56,7 @@ extern int piranha_simulator; * ioctls. */ -static loff_t rtc_llseek(struct file *file, loff_t offset, int origin); - -static ssize_t rtc_read(struct file *file, char *buf, +static ssize_t rtc_read(struct file *file, char __user *buf, size_t count, loff_t *ppos); static int rtc_ioctl(struct inode *inode, struct file *file, @@ -81,12 +79,7 @@ static const unsigned char days_in_mo[] = * Now all the various file operations that we export. */ -static loff_t rtc_llseek(struct file *file, loff_t offset, int origin) -{ - return -ESPIPE; -} - -static ssize_t rtc_read(struct file *file, char *buf, +static ssize_t rtc_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { return -EIO; @@ -113,7 +106,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, if (!capable(CAP_SYS_TIME)) return -EACCES; - if (copy_from_user(&rtc_tm, (struct rtc_time*)arg, + if (copy_from_user(&rtc_tm, (struct rtc_time __user *)arg, sizeof(struct rtc_time))) return -EFAULT; @@ -147,7 +140,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, } case RTC_EPOCH_READ: /* Read the epoch. */ { - return put_user (epoch, (unsigned long *)arg); + return put_user (epoch, (unsigned long __user *)arg); } case RTC_EPOCH_SET: /* Set the epoch. */ { @@ -166,11 +159,12 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, default: return -EINVAL; } - return copy_to_user((void *)arg, &wtime, sizeof wtime) ? -EFAULT : 0; + return copy_to_user((void __user *)arg, &wtime, sizeof wtime) ? -EFAULT : 0; } static int rtc_open(struct inode *inode, struct file *file) { + nonseekable_open(inode, file); return 0; } @@ -184,7 +178,7 @@ static int rtc_release(struct inode *inode, struct file *file) */ static struct file_operations rtc_fops = { .owner = THIS_MODULE, - .llseek = rtc_llseek, + .llseek = no_llseek, .read = rtc_read, .ioctl = rtc_ioctl, .open = rtc_open, diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c index 1395840ba98f7d..3589f48ded4752 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c @@ -88,11 +88,11 @@ struct appldata_parameter_list { */ static const char appldata_proc_name[APPLDATA_PROC_NAME_LENGTH] = "appldata"; static int appldata_timer_handler(ctl_table *ctl, int write, struct file *filp, - void __user *buffer, size_t *lenp); + void __user *buffer, size_t *lenp, loff_t *ppos); static int appldata_interval_handler(ctl_table *ctl, int write, struct file *filp, void __user *buffer, - size_t *lenp); + size_t *lenp, loff_t *ppos); static struct ctl_table_header *appldata_sysctl_header; static struct ctl_table appldata_table[] = { @@ -315,12 +315,12 @@ __appldata_vtimer_setup(int cmd) */ static int appldata_timer_handler(ctl_table *ctl, int write, struct file *filp, - void __user *buffer, size_t *lenp) + void __user *buffer, size_t *lenp, loff_t *ppos) { int len; char buf[2]; - if (!*lenp || filp->f_pos) { + if (!*lenp || *ppos) { *lenp = 0; return 0; } @@ -343,7 +343,7 @@ appldata_timer_handler(ctl_table *ctl, int write, struct file *filp, spin_unlock(&appldata_timer_lock); out: *lenp = len; - filp->f_pos += len; + *ppos += len; return 0; } @@ -355,12 +355,12 @@ out: */ static int appldata_interval_handler(ctl_table *ctl, int write, struct file *filp, - void __user *buffer, size_t *lenp) + void __user *buffer, size_t *lenp, loff_t *ppos) { int len, interval; char buf[16]; - if (!*lenp || filp->f_pos) { + if (!*lenp || *ppos) { *lenp = 0; return 0; } @@ -391,7 +391,7 @@ appldata_interval_handler(ctl_table *ctl, int write, struct file *filp, interval); out: *lenp = len; - filp->f_pos += len; + *ppos += len; return 0; } @@ -403,7 +403,7 @@ out: */ static int appldata_generic_handler(ctl_table *ctl, int write, struct file *filp, - void __user *buffer, size_t *lenp) + void __user *buffer, size_t *lenp, loff_t *ppos) { struct appldata_ops *ops = NULL, *tmp_ops; int rc, len, found; @@ -429,7 +429,7 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp, } spin_unlock_bh(&appldata_ops_lock); - if (!*lenp || filp->f_pos) { + if (!*lenp || *ppos) { *lenp = 0; module_put(ops->owner); return 0; @@ -488,7 +488,7 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp, spin_unlock_bh(&appldata_ops_lock); out: *lenp = len; - filp->f_pos += len; + *ppos += len; module_put(ops->owner); return 0; } diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c index 170da71fa2ff3c..cb29503010616d 100644 --- a/arch/s390/mm/cmm.c +++ b/arch/s390/mm/cmm.c @@ -256,13 +256,13 @@ static struct ctl_table cmm_table[]; static int cmm_pages_handler(ctl_table *ctl, int write, struct file *filp, - void *buffer, size_t *lenp) + void *buffer, size_t *lenp, loff_t *ppos) { char buf[16], *p; long pages; int len; - if (!*lenp || (filp->f_pos && !write)) { + if (!*lenp || (*ppos && !write)) { *lenp = 0; return 0; } @@ -291,19 +291,19 @@ cmm_pages_handler(ctl_table *ctl, int write, struct file *filp, return -EFAULT; } *lenp = len; - filp->f_pos += len; + *ppos += len; return 0; } static int cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp, - void *buffer, size_t *lenp) + void *buffer, size_t *lenp, loff_t *ppos) { char buf[64], *p; long pages, seconds; int len; - if (!*lenp || (filp->f_pos && !write)) { + if (!*lenp || (*ppos && !write)) { *lenp = 0; return 0; } @@ -328,7 +328,7 @@ cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp, return -EFAULT; } *lenp = len; - filp->f_pos += len; + *ppos += len; return 0; } diff --git a/arch/um/drivers/harddog_kern.c b/arch/um/drivers/harddog_kern.c index e3f3cddeadaa89..147ec19f6bb9dc 100644 --- a/arch/um/drivers/harddog_kern.c +++ b/arch/um/drivers/harddog_kern.c @@ -82,7 +82,7 @@ static int harddog_open(struct inode *inode, struct file *file) timer_alive = 1; unlock_kernel(); - return 0; + return nonseekable_open(inode, file); } extern void stop_watchdog(int in_fd, int out_fd); @@ -108,10 +108,6 @@ extern int ping_watchdog(int fd); static ssize_t harddog_write(struct file *file, const char *data, size_t len, loff_t *ppos) { - /* Can't seek (pwrite) on this device */ - if (ppos != &file->f_pos) - return -ESPIPE; - /* * Refresh the timer. */ |