lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Mon, 21 Dec 2015 23:46:53 +0000 From: Al Viro <viro@...IV.linux.org.uk> To: linux-kernel@...r.kernel.org Cc: Linus Torvalds <torvalds@...ux-foundation.org> Subject: [POC][PATCH 20/83] staging/rdma: get rid of pointless casts From: Al Viro <viro@...iv.linux.org.uk> Signed-off-by: Al Viro <viro@...iv.linux.org.uk> --- drivers/staging/rdma/ehca/ehca_pd.c | 2 +- drivers/staging/rdma/ehca/ipz_pt_fn.c | 6 +++--- drivers/staging/rdma/ehca/ipz_pt_fn.h | 2 +- drivers/staging/rdma/hfi1/qp.c | 6 +++--- drivers/staging/rdma/ipath/ipath_qp.c | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/rdma/ehca/ehca_pd.c b/drivers/staging/rdma/ehca/ehca_pd.c index c3424f4..351577a 100644 --- a/drivers/staging/rdma/ehca/ehca_pd.c +++ b/drivers/staging/rdma/ehca/ehca_pd.c @@ -92,7 +92,7 @@ int ehca_dealloc_pd(struct ib_pd *pd) list_splice(&my_pd->full[i], &my_pd->free[i]); list_for_each_entry_safe(page, tmp, &my_pd->free[i], list) { leftovers = 1; - free_page((void *)page->page); + free_page(page->page); kmem_cache_free(small_qp_cache, page); } } diff --git a/drivers/staging/rdma/ehca/ipz_pt_fn.c b/drivers/staging/rdma/ehca/ipz_pt_fn.c index 267df34..94deabc 100644 --- a/drivers/staging/rdma/ehca/ipz_pt_fn.c +++ b/drivers/staging/rdma/ehca/ipz_pt_fn.c @@ -140,7 +140,7 @@ static int alloc_small_queue_page(struct ipz_queue *queue, struct ehca_pd *pd) if (!page) goto out; - page->page = (unsigned long)get_zeroed_page(GFP_KERNEL); + page->page = get_zeroed_page(GFP_KERNEL); if (!page->page) { kmem_cache_free(small_qp_cache, page); goto out; @@ -158,7 +158,7 @@ static int alloc_small_queue_page(struct ipz_queue *queue, struct ehca_pd *pd) mutex_unlock(&pd->lock); - queue->queue_pages[0] = (void *)(page->page | (bit << (order + 9))); + queue->queue_pages[0] = page->page + (bit << (order + 9)); queue->small_page = page; queue->offset = bit << (order + 9); return 1; @@ -196,7 +196,7 @@ static void free_small_queue_page(struct ipz_queue *queue, struct ehca_pd *pd) mutex_unlock(&pd->lock); if (free_page) { - free_page((void *)page->page); + free_page(page->page); kmem_cache_free(small_qp_cache, page); } } diff --git a/drivers/staging/rdma/ehca/ipz_pt_fn.h b/drivers/staging/rdma/ehca/ipz_pt_fn.h index a801274..e695ed2 100644 --- a/drivers/staging/rdma/ehca/ipz_pt_fn.h +++ b/drivers/staging/rdma/ehca/ipz_pt_fn.h @@ -64,7 +64,7 @@ struct ipz_page { #define IPZ_SPAGE_PER_KPAGE (PAGE_SIZE / 512) struct ipz_small_queue_page { - unsigned long page; + void *page; unsigned long bitmap[IPZ_SPAGE_PER_KPAGE / BITS_PER_LONG]; int fill; void *mapped_addr; diff --git a/drivers/staging/rdma/hfi1/qp.c b/drivers/staging/rdma/hfi1/qp.c index 4445610..701249d 100644 --- a/drivers/staging/rdma/hfi1/qp.c +++ b/drivers/staging/rdma/hfi1/qp.c @@ -120,7 +120,7 @@ static const u16 credit_table[31] = { static void get_map_page(struct hfi1_qpn_table *qpt, struct qpn_map *map) { - unsigned long page = (unsigned long)get_zeroed_page(GFP_KERNEL); + void *page = get_zeroed_page(GFP_KERNEL); /* * Free the page if someone raced with us installing it. @@ -128,9 +128,9 @@ static void get_map_page(struct hfi1_qpn_table *qpt, struct qpn_map *map) spin_lock(&qpt->lock); if (map->page) - free_page((void *)page); + free_page(page); else - map->page = (void *)page; + map->page = page; spin_unlock(&qpt->lock); } diff --git a/drivers/staging/rdma/ipath/ipath_qp.c b/drivers/staging/rdma/ipath/ipath_qp.c index 51fa380..b4ed2ef 100644 --- a/drivers/staging/rdma/ipath/ipath_qp.c +++ b/drivers/staging/rdma/ipath/ipath_qp.c @@ -85,7 +85,7 @@ static u32 credit_table[31] = { static void get_map_page(struct ipath_qp_table *qpt, struct qpn_map *map) { - unsigned long page = (unsigned long)get_zeroed_page(GFP_KERNEL); + void *page = get_zeroed_page(GFP_KERNEL); unsigned long flags; /* @@ -94,9 +94,9 @@ static void get_map_page(struct ipath_qp_table *qpt, struct qpn_map *map) spin_lock_irqsave(&qpt->lock, flags); if (map->page) - free_page((void *)page); + free_page(page); else - map->page = (void *)page; + map->page = page; spin_unlock_irqrestore(&qpt->lock, flags); } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists