diff options
Diffstat (limited to 'fs/openpromfs')
-rw-r--r-- | fs/openpromfs/inode.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c index c0cbe97cdc60..3bd2eeccb2ad 100644 --- a/fs/openpromfs/inode.c +++ b/fs/openpromfs/inode.c | |||
@@ -72,7 +72,7 @@ static ssize_t nodenum_read(struct file *file, char __user *buf, | |||
72 | 72 | ||
73 | if (count < 0 || !inode->u.generic_ip) | 73 | if (count < 0 || !inode->u.generic_ip) |
74 | return -EINVAL; | 74 | return -EINVAL; |
75 | sprintf (buffer, "%8.8x\n", (u32)(long)(inode->u.generic_ip)); | 75 | sprintf (buffer, "%8.8lx\n", (long)inode->u.generic_ip); |
76 | if (file->f_pos >= 9) | 76 | if (file->f_pos >= 9) |
77 | return 0; | 77 | return 0; |
78 | if (count > 9 - file->f_pos) | 78 | if (count > 9 - file->f_pos) |
@@ -123,7 +123,7 @@ static ssize_t property_read(struct file *filp, char __user *buf, | |||
123 | GFP_KERNEL); | 123 | GFP_KERNEL); |
124 | if (!filp->private_data) | 124 | if (!filp->private_data) |
125 | return -ENOMEM; | 125 | return -ENOMEM; |
126 | op = (openprom_property *)filp->private_data; | 126 | op = filp->private_data; |
127 | op->flag = 0; | 127 | op->flag = 0; |
128 | op->alloclen = 2 * i; | 128 | op->alloclen = 2 * i; |
129 | strcpy (op->name, p); | 129 | strcpy (op->name, p); |
@@ -163,7 +163,7 @@ static ssize_t property_read(struct file *filp, char __user *buf, | |||
163 | op->len--; | 163 | op->len--; |
164 | } | 164 | } |
165 | } else | 165 | } else |
166 | op = (openprom_property *)filp->private_data; | 166 | op = filp->private_data; |
167 | if (!count || !(op->len || (op->flag & OPP_ASCIIZ))) | 167 | if (!count || !(op->len || (op->flag & OPP_ASCIIZ))) |
168 | return 0; | 168 | return 0; |
169 | if (*ppos >= 0xffffff || count >= 0xffffff) | 169 | if (*ppos >= 0xffffff || count >= 0xffffff) |
@@ -335,7 +335,7 @@ static ssize_t property_write(struct file *filp, const char __user *buf, | |||
335 | return i; | 335 | return i; |
336 | } | 336 | } |
337 | k = *ppos; | 337 | k = *ppos; |
338 | op = (openprom_property *)filp->private_data; | 338 | op = filp->private_data; |
339 | if (!(op->flag & OPP_STRING)) { | 339 | if (!(op->flag & OPP_STRING)) { |
340 | u32 *first, *last; | 340 | u32 *first, *last; |
341 | int first_off, last_cnt; | 341 | int first_off, last_cnt; |
@@ -388,13 +388,13 @@ static ssize_t property_write(struct file *filp, const char __user *buf, | |||
388 | memcpy (b, filp->private_data, | 388 | memcpy (b, filp->private_data, |
389 | sizeof (openprom_property) | 389 | sizeof (openprom_property) |
390 | + strlen (op->name) + op->alloclen); | 390 | + strlen (op->name) + op->alloclen); |
391 | memset (((char *)b) + sizeof (openprom_property) | 391 | memset (b + sizeof (openprom_property) |
392 | + strlen (op->name) + op->alloclen, | 392 | + strlen (op->name) + op->alloclen, |
393 | 0, 2 * i - op->alloclen); | 393 | 0, 2 * i - op->alloclen); |
394 | op = (openprom_property *)b; | 394 | op = b; |
395 | op->alloclen = 2*i; | 395 | op->alloclen = 2*i; |
396 | b = filp->private_data; | 396 | b = filp->private_data; |
397 | filp->private_data = (void *)op; | 397 | filp->private_data = op; |
398 | kfree (b); | 398 | kfree (b); |
399 | } | 399 | } |
400 | first = ((u32 *)op->value) + (k / 9); | 400 | first = ((u32 *)op->value) + (k / 9); |
@@ -498,13 +498,13 @@ write_try_string: | |||
498 | memcpy (b, filp->private_data, | 498 | memcpy (b, filp->private_data, |
499 | sizeof (openprom_property) | 499 | sizeof (openprom_property) |
500 | + strlen (op->name) + op->alloclen); | 500 | + strlen (op->name) + op->alloclen); |
501 | memset (((char *)b) + sizeof (openprom_property) | 501 | memset (b + sizeof (openprom_property) |
502 | + strlen (op->name) + op->alloclen, | 502 | + strlen (op->name) + op->alloclen, |
503 | 0, 2*(count - *ppos) - op->alloclen); | 503 | 0, 2*(count - *ppos) - op->alloclen); |
504 | op = (openprom_property *)b; | 504 | op = b; |
505 | op->alloclen = 2*(count + *ppos); | 505 | op->alloclen = 2*(count + *ppos); |
506 | b = filp->private_data; | 506 | b = filp->private_data; |
507 | filp->private_data = (void *)op; | 507 | filp->private_data = op; |
508 | kfree (b); | 508 | kfree (b); |
509 | } | 509 | } |
510 | p = op->value + *ppos - ((op->flag & OPP_QUOTED) ? 1 : 0); | 510 | p = op->value + *ppos - ((op->flag & OPP_QUOTED) ? 1 : 0); |
@@ -533,7 +533,7 @@ write_try_string: | |||
533 | 533 | ||
534 | int property_release (struct inode *inode, struct file *filp) | 534 | int property_release (struct inode *inode, struct file *filp) |
535 | { | 535 | { |
536 | openprom_property *op = (openprom_property *)filp->private_data; | 536 | openprom_property *op = filp->private_data; |
537 | int error; | 537 | int error; |
538 | u32 node; | 538 | u32 node; |
539 | 539 | ||
@@ -932,7 +932,7 @@ static int __init check_space (u16 n) | |||
932 | return -1; | 932 | return -1; |
933 | 933 | ||
934 | if (nodes) { | 934 | if (nodes) { |
935 | memcpy ((char *)pages, (char *)nodes, | 935 | memcpy ((char *)pages, nodes, |
936 | (1 << alloced) * PAGE_SIZE); | 936 | (1 << alloced) * PAGE_SIZE); |
937 | free_pages ((unsigned long)nodes, alloced); | 937 | free_pages ((unsigned long)nodes, alloced); |
938 | } | 938 | } |