return 0;
 }
 
-void rxe_cq_cleanup(void *arg)
+void rxe_cq_cleanup(struct rxe_pool_entry *arg)
 {
-       struct rxe_cq *cq = arg;
+       struct rxe_cq *cq = container_of(arg, typeof(*cq), pelem);
 
        if (cq->queue)
                rxe_queue_cleanup(cq->queue);
 
 
 int rxe_cq_post(struct rxe_cq *cq, struct rxe_cqe *cqe, int solicited);
 
-void rxe_cq_cleanup(void *arg);
+void rxe_cq_cleanup(struct rxe_pool_entry *arg);
 
 /* rxe_mcast.c */
 int rxe_mcast_get_grp(struct rxe_dev *rxe, union ib_gid *mgid,
 
 void rxe_drop_all_mcast_groups(struct rxe_qp *qp);
 
-void rxe_mc_cleanup(void *arg);
+void rxe_mc_cleanup(struct rxe_pool_entry *arg);
 
 /* rxe_mmap.c */
 struct rxe_mmap_info {
 int rxe_mem_map_pages(struct rxe_dev *rxe, struct rxe_mem *mem,
                      u64 *page, int num_pages, u64 iova);
 
-void rxe_mem_cleanup(void *arg);
+void rxe_mem_cleanup(struct rxe_pool_entry *arg);
 
 int advance_dma_data(struct rxe_dma_info *dma, unsigned int length);
 
 
 void rxe_qp_destroy(struct rxe_qp *qp);
 
-void rxe_qp_cleanup(void *arg);
+void rxe_qp_cleanup(struct rxe_pool_entry *arg);
 
 static inline int qp_num(struct rxe_qp *qp)
 {
 
        }
 }
 
-void rxe_mc_cleanup(void *arg)
+void rxe_mc_cleanup(struct rxe_pool_entry *arg)
 {
-       struct rxe_mc_grp *grp = arg;
+       struct rxe_mc_grp *grp = container_of(arg, typeof(*grp), pelem);
        struct rxe_dev *rxe = grp->rxe;
 
        rxe_drop_key(grp);
 
        mem->map_shift          = ilog2(RXE_BUF_PER_MAP);
 }
 
-void rxe_mem_cleanup(void *arg)
+void rxe_mem_cleanup(struct rxe_pool_entry *arg)
 {
-       struct rxe_mem *mem = arg;
+       struct rxe_mem *mem = container_of(arg, typeof(*mem), pelem);
        int i;
 
        if (mem->umem)
 
        RXE_NUM_TYPES,          /* keep me last */
 };
 
+struct rxe_pool_entry;
+
 struct rxe_type_info {
        const char              *name;
        size_t                  size;
-       void                    (*cleanup)(void *obj);
+       void                    (*cleanup)(struct rxe_pool_entry *obj);
        enum rxe_pool_flags     flags;
        u32                     max_index;
        u32                     min_index;
        spinlock_t              pool_lock; /* pool spinlock */
        size_t                  elem_size;
        struct kref             ref_cnt;
-       void                    (*cleanup)(void *obj);
+       void                    (*cleanup)(struct rxe_pool_entry *obj);
        enum rxe_pool_state     state;
        enum rxe_pool_flags     flags;
        enum rxe_elem_type      type;
 
 }
 
 /* called when the last reference to the qp is dropped */
-void rxe_qp_cleanup(void *arg)
+void rxe_qp_cleanup(struct rxe_pool_entry *arg)
 {
-       struct rxe_qp *qp = arg;
+       struct rxe_qp *qp = container_of(arg, typeof(*qp), pelem);
 
        rxe_drop_all_mcast_groups(qp);
 
 
 int rxe_register_device(struct rxe_dev *rxe);
 int rxe_unregister_device(struct rxe_dev *rxe);
 
-void rxe_mc_cleanup(void *arg);
+void rxe_mc_cleanup(struct rxe_pool_entry *arg);
 
 #endif /* RXE_VERBS_H */