Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97933
b: refs/heads/master
c: ea23ec2
h: refs/heads/master
i:
  97931: 690cd0c
v: v3
  • Loading branch information
Akinobu Mita authored and David S. Miller committed Jun 10, 2008
1 parent 39bc06c commit 91b1bcf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 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: 495b36b15e17fb08434e3800959434f06a1a6fbc
refs/heads/master: ea23ec26727b4df97b4965715f0519b6ddc0aa4b
29 changes: 8 additions & 21 deletions trunk/drivers/isdn/hysdn/hysdn_procconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,30 +207,17 @@ hysdn_conf_write(struct file *file, const char __user *buf, size_t count, loff_t
/* read conf file -> output card info data */
/*******************************************/
static ssize_t
hysdn_conf_read(struct file *file, char __user *buf, size_t count, loff_t * off)
hysdn_conf_read(struct file *file, char __user *buf, size_t count, loff_t *off)
{
char *cp;
int i;

if (file->f_mode & FMODE_READ) {
if (!(cp = file->private_data))
return (-EFAULT); /* should never happen */
i = strlen(cp); /* get total string length */
if (*off < i) {
/* still bytes to transfer */
cp += *off; /* point to desired data offset */
i -= *off; /* remaining length */
if (i > count)
i = count; /* limit length to transfer */
if (copy_to_user(buf, cp, i))
return (-EFAULT); /* copy error */
*off += i; /* adjust offset */
} else
return (0);
} else
return (-EPERM); /* no permission to read */

return (i);
if (!(file->f_mode & FMODE_READ))
return -EPERM; /* no permission to read */

if (!(cp = file->private_data))
return -EFAULT; /* should never happen */

return simple_read_from_buffer(buf, count, off, cp, strlen(cp));
} /* hysdn_conf_read */

/******************/
Expand Down

0 comments on commit 91b1bcf

Please sign in to comment.