Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29693
b: refs/heads/master
c: a04ee14
h: refs/heads/master
i:
  29691: 7fec03a
v: v3
  • Loading branch information
Jan Engelhardt authored and Linus Torvalds committed Jun 25, 2006
1 parent 2878700 commit 0e44a0b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 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: 515decdccf81cfbf5273d7f0085aea954ecd26c4
refs/heads/master: a04ee14636fa339c4609766bd6173629d4f9026e
15 changes: 10 additions & 5 deletions trunk/fs/openpromfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ static int openpromfs_readdir(struct file *, void *, filldir_t);
static struct dentry *openpromfs_lookup(struct inode *, struct dentry *dentry, struct nameidata *nd);
static int openpromfs_unlink (struct inode *, struct dentry *dentry);

static inline u16 ptr_nod(void *p)
{
return (long)p & 0xFFFF;
}

static ssize_t nodenum_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
Expand Down Expand Up @@ -95,9 +100,9 @@ static ssize_t property_read(struct file *filp, char __user *buf,
char buffer[64];

if (!filp->private_data) {
node = nodes[(u16)((long)inode->u.generic_ip)].node;
node = nodes[ptr_nod(inode->u.generic_ip)].node;
i = ((u32)(long)inode->u.generic_ip) >> 16;
if ((u16)((long)inode->u.generic_ip) == aliases) {
if (ptr_nod(inode->u.generic_ip) == aliases) {
if (i >= aliases_nodes)
p = NULL;
else
Expand All @@ -111,7 +116,7 @@ static ssize_t property_read(struct file *filp, char __user *buf,
return -EIO;
i = prom_getproplen (node, p);
if (i < 0) {
if ((u16)((long)inode->u.generic_ip) == aliases)
if (ptr_nod(inode->u.generic_ip) == aliases)
i = 0;
else
return -EIO;
Expand Down Expand Up @@ -540,8 +545,8 @@ int property_release (struct inode *inode, struct file *filp)
if (!op)
return 0;
lock_kernel();
node = nodes[(u16)((long)inode->u.generic_ip)].node;
if ((u16)((long)inode->u.generic_ip) == aliases) {
node = nodes[ptr_nod(inode->u.generic_ip)].node;
if (ptr_nod(inode->u.generic_ip) == aliases) {
if ((op->flag & OPP_DIRTY) && (op->flag & OPP_STRING)) {
char *p = op->name;
int i = (op->value - op->name) - strlen (op->name) - 1;
Expand Down

0 comments on commit 0e44a0b

Please sign in to comment.