Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15181
b: refs/heads/master
c: 538bacf
h: refs/heads/master
i:
  15179: 37f1f9f
v: v3
  • Loading branch information
Al Viro authored and Linus Torvalds committed Dec 15, 2005
1 parent e38379b commit f8e9771
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d22043940eb8d660df9a94e8e439ab4d3d16edab
refs/heads/master: 538bacf8a4802d209f955726b66891b8a921dabf
13 changes: 7 additions & 6 deletions trunk/drivers/char/watchdog/booke_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static __inline__ void booke_wdt_ping(void)
/*
* booke_wdt_write:
*/
static ssize_t booke_wdt_write (struct file *file, const char *buf,
static ssize_t booke_wdt_write (struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
booke_wdt_ping();
Expand All @@ -92,14 +92,15 @@ static int booke_wdt_ioctl (struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
u32 tmp = 0;
u32 __user *p = (u32 __user *)arg;

switch (cmd) {
case WDIOC_GETSUPPORT:
if (copy_to_user ((struct watchdog_info *) arg, &ident,
if (copy_to_user ((struct watchdog_info __user *) arg, &ident,
sizeof(struct watchdog_info)))
return -EFAULT;
case WDIOC_GETSTATUS:
return put_user(ident.options, (u32 *) arg);
return put_user(ident.options, p);
case WDIOC_GETBOOTSTATUS:
/* XXX: something is clearing TSR */
tmp = mfspr(SPRN_TSR) & TSR_WRS(3);
Expand All @@ -109,14 +110,14 @@ static int booke_wdt_ioctl (struct inode *inode, struct file *file,
booke_wdt_ping();
return 0;
case WDIOC_SETTIMEOUT:
if (get_user(booke_wdt_period, (u32 *) arg))
if (get_user(booke_wdt_period, p))
return -EFAULT;
mtspr(SPRN_TCR, (mfspr(SPRN_TCR)&~WDTP(0))|WDTP(booke_wdt_period));
return 0;
case WDIOC_GETTIMEOUT:
return put_user(booke_wdt_period, (u32 *) arg);
return put_user(booke_wdt_period, p);
case WDIOC_SETOPTIONS:
if (get_user(tmp, (u32 *) arg))
if (get_user(tmp, p))
return -EINVAL;
if (tmp == WDIOS_ENABLECARD) {
booke_wdt_ping();
Expand Down

0 comments on commit f8e9771

Please sign in to comment.