C++ compatibility for some kernel-space headers

This commit is contained in:
Sebastian Huber 2019-02-18 10:04:53 +01:00
parent 0dbc4e269b
commit c352e6979d
3 changed files with 13 additions and 13 deletions

View File

@ -152,7 +152,7 @@ ck_stack_batch_pop_upmc(struct ck_stack *target)
{
struct ck_stack_entry *entry;
entry = ck_pr_fas_ptr(&target->head, NULL);
entry = (struct ck_stack_entry *)ck_pr_fas_ptr(&target->head, NULL);
ck_pr_fence_load();
return entry;
}
@ -276,7 +276,7 @@ ck_stack_push_mpnc(struct ck_stack *target, struct ck_stack_entry *entry)
entry->next = NULL;
ck_pr_fence_store_atomic();
stack = ck_pr_fas_ptr(&target->head, entry);
stack = (struct ck_stack_entry *)ck_pr_fas_ptr(&target->head, entry);
ck_pr_store_ptr(&entry->next, stack);
ck_pr_fence_store();

View File

@ -336,7 +336,7 @@ drbr_enqueue(struct ifnet *ifp, struct buf_ring *br, struct mbuf *m)
}
static __inline void
drbr_putback(struct ifnet *ifp, struct buf_ring *br, struct mbuf *new)
drbr_putback(struct ifnet *ifp, struct buf_ring *br, struct mbuf *m)
{
/*
* The top of the list needs to be swapped
@ -348,11 +348,11 @@ drbr_putback(struct ifnet *ifp, struct buf_ring *br, struct mbuf *new)
* Peek in altq case dequeued it
* so put it back.
*/
IFQ_DRV_PREPEND(&ifp->if_snd, new);
IFQ_DRV_PREPEND(&ifp->if_snd, m);
return;
}
#endif
buf_ring_putback_sc(br, new);
buf_ring_putback_sc(br, m);
}
static __inline struct mbuf *
@ -371,7 +371,7 @@ drbr_peek(struct ifnet *ifp, struct buf_ring *br)
return (m);
}
#endif
return(buf_ring_peek_clear_sc(br));
return ((struct mbuf *)buf_ring_peek_clear_sc(br));
}
static __inline void
@ -383,7 +383,7 @@ drbr_flush(struct ifnet *ifp, struct buf_ring *br)
if (ifp != NULL && ALTQ_IS_ENABLED(&ifp->if_snd))
IFQ_PURGE(&ifp->if_snd);
#endif
while ((m = buf_ring_dequeue_sc(br)) != NULL)
while ((m = (struct mbuf *)buf_ring_dequeue_sc(br)) != NULL)
m_freem(m);
}
@ -406,7 +406,7 @@ drbr_dequeue(struct ifnet *ifp, struct buf_ring *br)
return (m);
}
#endif
return (buf_ring_dequeue_sc(br));
return ((struct mbuf *)buf_ring_dequeue_sc(br));
}
static __inline void
@ -439,11 +439,11 @@ drbr_dequeue_cond(struct ifnet *ifp, struct buf_ring *br,
return (m);
}
#endif
m = buf_ring_peek(br);
m = (struct mbuf *)buf_ring_peek(br);
if (m == NULL || func(m, arg) == 0)
return (NULL);
return (buf_ring_dequeue_sc(br));
return ((struct mbuf *)buf_ring_dequeue_sc(br));
}
static __inline int

View File

@ -776,7 +776,7 @@ m_get(int how, short type)
args.flags = 0;
args.type = type;
m = uma_zalloc_arg(zone_mbuf, &args, how);
m = (struct mbuf *)uma_zalloc_arg(zone_mbuf, &args, how);
MBUF_PROBE3(m__get, how, type, m);
return (m);
}
@ -789,7 +789,7 @@ m_gethdr(int how, short type)
args.flags = M_PKTHDR;
args.type = type;
m = uma_zalloc_arg(zone_mbuf, &args, how);
m = (struct mbuf *)uma_zalloc_arg(zone_mbuf, &args, how);
MBUF_PROBE3(m__gethdr, how, type, m);
return (m);
}
@ -802,7 +802,7 @@ m_getcl(int how, short type, int flags)
args.flags = flags;
args.type = type;
m = uma_zalloc_arg(zone_pack, &args, how);
m = (struct mbuf *)uma_zalloc_arg(zone_pack, &args, how);
MBUF_PROBE4(m__getcl, how, type, flags, m);
return (m);
}