Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1296392 > unrolled thread

[POC][PATCH 14/83] proc_dev_atm_read(): get rid of pointless casts

Started byAl Viro <viro@ZenIV.linux.org.uk>
First post2015-12-22 01:20 +0100
Last post2015-12-22 01:20 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [POC][PATCH 14/83] proc_dev_atm_read(): get rid of pointless casts Al Viro <viro@ZenIV.linux.org.uk> - 2015-12-22 01:20 +0100

#1296392 — [POC][PATCH 14/83] proc_dev_atm_read(): get rid of pointless casts

FromAl Viro <viro@ZenIV.linux.org.uk>
Date2015-12-22 01:20 +0100
Subject[POC][PATCH 14/83] proc_dev_atm_read(): get rid of pointless casts
Message-ID<qIiQi-548-27@gated-at.bofh.it>
From: Al Viro <viro@zeniv.linux.org.uk>

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 net/atm/proc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/atm/proc.c b/net/atm/proc.c
index cf8993a..d04e11f 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -377,28 +377,28 @@ static ssize_t proc_dev_atm_read(struct file *file, char __user *buf,
 				 size_t count, loff_t *pos)
 {
 	struct atm_dev *dev;
-	unsigned long page;
+	char *page;
 	int length;
 
 	if (count == 0)
 		return 0;
-	page = (unsigned long)get_zeroed_page(GFP_KERNEL);
+	page = get_zeroed_page(GFP_KERNEL);
 	if (!page)
 		return -ENOMEM;
 	dev = PDE_DATA(file_inode(file));
 	if (!dev->ops->proc_read)
 		length = -EINVAL;
 	else {
-		length = dev->ops->proc_read(dev, pos, (char *)page);
+		length = dev->ops->proc_read(dev, pos, page);
 		if (length > count)
 			length = -EINVAL;
 	}
 	if (length >= 0) {
-		if (copy_to_user(buf, (char *)page, length))
+		if (copy_to_user(buf, page, length))
 			length = -EFAULT;
 		(*pos)++;
 	}
-	free_page((void *)page);
+	free_page(page);
 	return length;
 }
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web