[POC][PATCH 38/83] usb_mon: get rid of pointless casts
From: Al Viro
Date: Mon Dec 21 2015 - 19:03:49 EST
From: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
---
drivers/usb/mon/mon_bin.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c
index cdc68e5..26d497b 100644
--- a/drivers/usb/mon/mon_bin.c
+++ b/drivers/usb/mon/mon_bin.c
@@ -1305,17 +1305,16 @@ static int mon_bin_wait_event(struct file *file, struct mon_reader_bin *rp)
static int mon_alloc_buff(struct mon_pgmap *map, int npages)
{
int n;
- unsigned long vaddr;
for (n = 0; n < npages; n++) {
- vaddr = (unsigned long)get_zeroed_page(GFP_KERNEL);
- if (vaddr == 0) {
+ void *vaddr = get_zeroed_page(GFP_KERNEL);
+ if (!vaddr) {
while (n-- != 0)
free_page(map[n].ptr);
return -ENOMEM;
}
- map[n].ptr = (unsigned char *) vaddr;
- map[n].pg = virt_to_page((void *) vaddr);
+ map[n].ptr = vaddr;
+ map[n].pg = virt_to_page(vaddr);
}
return 0;
}
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/