diff options
Diffstat (limited to 'sys/contrib/altq')
-rw-r--r-- | sys/contrib/altq/altq/altq_cbq.c | 10 | ||||
-rw-r--r-- | sys/contrib/altq/altq/altq_cdnr.c | 4 | ||||
-rw-r--r-- | sys/contrib/altq/altq/altq_hfsc.c | 68 | ||||
-rw-r--r-- | sys/contrib/altq/altq/altq_priq.c | 20 | ||||
-rw-r--r-- | sys/contrib/altq/altq/altq_red.c | 44 | ||||
-rw-r--r-- | sys/contrib/altq/altq/altq_rio.c | 22 | ||||
-rw-r--r-- | sys/contrib/altq/altq/altq_rmclass.c | 10 | ||||
-rw-r--r-- | sys/contrib/altq/altq/altq_subr.c | 14 |
8 files changed, 93 insertions, 99 deletions
diff --git a/sys/contrib/altq/altq/altq_cbq.c b/sys/contrib/altq/altq/altq_cbq.c index 7cdfb40..ca035de 100644 --- a/sys/contrib/altq/altq/altq_cbq.c +++ b/sys/contrib/altq/altq/altq_cbq.c @@ -273,7 +273,7 @@ cbq_add_altq(struct pf_altq *a) return (ENODEV); /* allocate and initialize cbq_state_t */ - MALLOC(cbqp, cbq_state_t *, sizeof(cbq_state_t), M_DEVBUF, M_WAITOK); + cbqp = malloc(sizeof(cbq_state_t), M_DEVBUF, M_WAITOK); if (cbqp == NULL) return (ENOMEM); bzero(cbqp, sizeof(cbq_state_t)); @@ -304,7 +304,7 @@ cbq_remove_altq(struct pf_altq *a) cbq_class_destroy(cbqp, cbqp->ifnp.root_); /* deallocate cbq_state_t */ - FREE(cbqp, M_DEVBUF); + free(cbqp, M_DEVBUF); return (0); } @@ -927,7 +927,7 @@ cbq_ifattach(ifacep) return (ENXIO); /* allocate and initialize cbq_state_t */ - MALLOC(new_cbqp, cbq_state_t *, sizeof(cbq_state_t), M_DEVBUF, M_WAITOK); + new_cbqp = malloc(sizeof(cbq_state_t), M_DEVBUF, M_WAITOK); if (new_cbqp == NULL) return (ENOMEM); bzero(new_cbqp, sizeof(cbq_state_t)); @@ -943,7 +943,7 @@ cbq_ifattach(ifacep) cbq_enqueue, cbq_dequeue, cbq_request, &new_cbqp->cbq_classifier, acc_classify); if (error) { - FREE(new_cbqp, M_DEVBUF); + free(new_cbqp, M_DEVBUF); return (error); } @@ -987,7 +987,7 @@ cbq_ifdetach(ifacep) } /* deallocate cbq_state_t */ - FREE(cbqp, M_DEVBUF); + free(cbqp, M_DEVBUF); return (0); } diff --git a/sys/contrib/altq/altq/altq_cdnr.c b/sys/contrib/altq/altq/altq_cdnr.c index 3139d51..b4f9065 100644 --- a/sys/contrib/altq/altq/altq_cdnr.c +++ b/sys/contrib/altq/altq/altq_cdnr.c @@ -274,7 +274,7 @@ cdnr_cballoc(top, type, input_func) return (NULL); } - MALLOC(cb, struct cdnr_block *, size, M_DEVBUF, M_WAITOK); + cb = malloc(size, M_DEVBUF, M_WAITOK); if (cb == NULL) return (NULL); bzero(cb, size); @@ -319,7 +319,7 @@ cdnr_cbdestroy(cblock) if (cb->cb_top != cblock) LIST_REMOVE(cb, cb_next); - FREE(cb, M_DEVBUF); + free(cb, M_DEVBUF); } /* diff --git a/sys/contrib/altq/altq/altq_hfsc.c b/sys/contrib/altq/altq/altq_hfsc.c index bf7a4f0..8beead7 100644 --- a/sys/contrib/altq/altq/altq_hfsc.c +++ b/sys/contrib/altq/altq/altq_hfsc.c @@ -202,7 +202,7 @@ hfsc_add_altq(struct pf_altq *a) if (!ALTQ_IS_READY(&ifp->if_snd)) return (ENODEV); - MALLOC(hif, struct hfsc_if *, sizeof(struct hfsc_if), + hif = malloc(sizeof(struct hfsc_if), M_DEVBUF, M_WAITOK); if (hif == NULL) return (ENOMEM); @@ -210,7 +210,7 @@ hfsc_add_altq(struct pf_altq *a) hif->hif_eligible = ellist_alloc(); if (hif->hif_eligible == NULL) { - FREE(hif, M_DEVBUF); + free(hif, M_DEVBUF); return (ENOMEM); } @@ -236,7 +236,7 @@ hfsc_remove_altq(struct pf_altq *a) ellist_destroy(hif->hif_eligible); - FREE(hif, M_DEVBUF); + free(hif, M_DEVBUF); return (0); } @@ -404,13 +404,13 @@ hfsc_class_create(struct hfsc_if *hif, struct service_curve *rsc, } #endif - MALLOC(cl, struct hfsc_class *, sizeof(struct hfsc_class), + cl = malloc(sizeof(struct hfsc_class), M_DEVBUF, M_WAITOK); if (cl == NULL) return (NULL); bzero(cl, sizeof(struct hfsc_class)); - MALLOC(cl->cl_q, class_queue_t *, sizeof(class_queue_t), + cl->cl_q = malloc(sizeof(class_queue_t), M_DEVBUF, M_WAITOK); if (cl->cl_q == NULL) goto err_ret; @@ -471,8 +471,7 @@ hfsc_class_create(struct hfsc_if *hif, struct service_curve *rsc, #endif /* ALTQ_RED */ if (rsc != NULL && (rsc->m1 != 0 || rsc->m2 != 0)) { - MALLOC(cl->cl_rsc, struct internal_sc *, - sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); + cl->cl_rsc = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); if (cl->cl_rsc == NULL) goto err_ret; sc2isc(rsc, cl->cl_rsc); @@ -480,16 +479,14 @@ hfsc_class_create(struct hfsc_if *hif, struct service_curve *rsc, rtsc_init(&cl->cl_eligible, cl->cl_rsc, 0, 0); } if (fsc != NULL && (fsc->m1 != 0 || fsc->m2 != 0)) { - MALLOC(cl->cl_fsc, struct internal_sc *, - sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); + cl->cl_fsc = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); if (cl->cl_fsc == NULL) goto err_ret; sc2isc(fsc, cl->cl_fsc); rtsc_init(&cl->cl_virtual, cl->cl_fsc, 0, 0); } if (usc != NULL && (usc->m1 != 0 || usc->m2 != 0)) { - MALLOC(cl->cl_usc, struct internal_sc *, - sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); + cl->cl_usc = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); if (cl->cl_usc == NULL) goto err_ret; sc2isc(usc, cl->cl_usc); @@ -565,14 +562,14 @@ hfsc_class_create(struct hfsc_if *hif, struct service_curve *rsc, #endif } if (cl->cl_fsc != NULL) - FREE(cl->cl_fsc, M_DEVBUF); + free(cl->cl_fsc, M_DEVBUF); if (cl->cl_rsc != NULL) - FREE(cl->cl_rsc, M_DEVBUF); + free(cl->cl_rsc, M_DEVBUF); if (cl->cl_usc != NULL) - FREE(cl->cl_usc, M_DEVBUF); + free(cl->cl_usc, M_DEVBUF); if (cl->cl_q != NULL) - FREE(cl->cl_q, M_DEVBUF); - FREE(cl, M_DEVBUF); + free(cl->cl_q, M_DEVBUF); + free(cl, M_DEVBUF); return (NULL); } @@ -649,13 +646,13 @@ hfsc_class_destroy(struct hfsc_class *cl) IFQ_UNLOCK(cl->cl_hif->hif_ifq); if (cl->cl_usc != NULL) - FREE(cl->cl_usc, M_DEVBUF); + free(cl->cl_usc, M_DEVBUF); if (cl->cl_fsc != NULL) - FREE(cl->cl_fsc, M_DEVBUF); + free(cl->cl_fsc, M_DEVBUF); if (cl->cl_rsc != NULL) - FREE(cl->cl_rsc, M_DEVBUF); - FREE(cl->cl_q, M_DEVBUF); - FREE(cl, M_DEVBUF); + free(cl->cl_rsc, M_DEVBUF); + free(cl->cl_q, M_DEVBUF); + free(cl, M_DEVBUF); return (0); } @@ -1203,7 +1200,7 @@ ellist_alloc(void) { ellist_t *head; - MALLOC(head, ellist_t *, sizeof(ellist_t), M_DEVBUF, M_WAITOK); + head = malloc(sizeof(ellist_t), M_DEVBUF, M_WAITOK); TAILQ_INIT(head); return (head); } @@ -1211,7 +1208,7 @@ ellist_alloc(void) static void ellist_destroy(ellist_t *head) { - FREE(head, M_DEVBUF); + free(head, M_DEVBUF); } static void @@ -1306,7 +1303,7 @@ actlist_alloc(void) { actlist_t *head; - MALLOC(head, actlist_t *, sizeof(actlist_t), M_DEVBUF, M_WAITOK); + head = malloc(sizeof(actlist_t), M_DEVBUF, M_WAITOK); TAILQ_INIT(head); return (head); } @@ -1314,7 +1311,7 @@ actlist_alloc(void) static void actlist_destroy(actlist_t *head) { - FREE(head, M_DEVBUF); + free(head, M_DEVBUF); } static void actlist_insert(struct hfsc_class *cl) @@ -1743,7 +1740,7 @@ hfsc_attach(ifq, bandwidth) { struct hfsc_if *hif; - MALLOC(hif, struct hfsc_if *, sizeof(struct hfsc_if), + hif = malloc(sizeof(struct hfsc_if), M_DEVBUF, M_WAITOK); if (hif == NULL) return (NULL); @@ -1751,7 +1748,7 @@ hfsc_attach(ifq, bandwidth) hif->hif_eligible = ellist_alloc(); if (hif->hif_eligible == NULL) { - FREE(hif, M_DEVBUF); + free(hif, M_DEVBUF); return NULL; } @@ -1787,7 +1784,7 @@ hfsc_detach(hif) ellist_destroy(hif->hif_eligible); - FREE(hif, M_DEVBUF); + free(hif, M_DEVBUF); return (0); } @@ -1804,22 +1801,19 @@ hfsc_class_modify(cl, rsc, fsc, usc) rsc_tmp = fsc_tmp = usc_tmp = NULL; if (rsc != NULL && (rsc->m1 != 0 || rsc->m2 != 0) && cl->cl_rsc == NULL) { - MALLOC(rsc_tmp, struct internal_sc *, - sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); + rsc_tmp = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); if (rsc_tmp == NULL) return (ENOMEM); } if (fsc != NULL && (fsc->m1 != 0 || fsc->m2 != 0) && cl->cl_fsc == NULL) { - MALLOC(fsc_tmp, struct internal_sc *, - sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); + fsc_tmp = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); if (fsc_tmp == NULL) return (ENOMEM); } if (usc != NULL && (usc->m1 != 0 || usc->m2 != 0) && cl->cl_usc == NULL) { - MALLOC(usc_tmp, struct internal_sc *, - sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); + usc_tmp = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); if (usc_tmp == NULL) return (ENOMEM); } @@ -1837,7 +1831,7 @@ hfsc_class_modify(cl, rsc, fsc, usc) if (cl->cl_rsc != NULL) { if (!qempty(cl->cl_q)) hfsc_purgeq(cl); - FREE(cl->cl_rsc, M_DEVBUF); + free(cl->cl_rsc, M_DEVBUF); cl->cl_rsc = NULL; } } else { @@ -1859,7 +1853,7 @@ hfsc_class_modify(cl, rsc, fsc, usc) if (cl->cl_fsc != NULL) { if (!qempty(cl->cl_q)) hfsc_purgeq(cl); - FREE(cl->cl_fsc, M_DEVBUF); + free(cl->cl_fsc, M_DEVBUF); cl->cl_fsc = NULL; } } else { @@ -1874,7 +1868,7 @@ hfsc_class_modify(cl, rsc, fsc, usc) if (usc != NULL) { if (usc->m1 == 0 && usc->m2 == 0) { if (cl->cl_usc != NULL) { - FREE(cl->cl_usc, M_DEVBUF); + free(cl->cl_usc, M_DEVBUF); cl->cl_usc = NULL; cl->cl_myf = 0; } diff --git a/sys/contrib/altq/altq/altq_priq.c b/sys/contrib/altq/altq/altq_priq.c index ec789c5a..ce9bdbc 100644 --- a/sys/contrib/altq/altq/altq_priq.c +++ b/sys/contrib/altq/altq/altq_priq.c @@ -134,7 +134,7 @@ priq_add_altq(struct pf_altq *a) if (!ALTQ_IS_READY(&ifp->if_snd)) return (ENODEV); - MALLOC(pif, struct priq_if *, sizeof(struct priq_if), + pif = malloc(sizeof(struct priq_if), M_DEVBUF, M_WAITOK); if (pif == NULL) return (ENOMEM); @@ -160,7 +160,7 @@ priq_remove_altq(struct pf_altq *a) (void)priq_clear_interface(pif); - FREE(pif, M_DEVBUF); + free(pif, M_DEVBUF); return (0); } @@ -320,13 +320,13 @@ priq_class_create(struct priq_if *pif, int pri, int qlimit, int flags, int qid) red_destroy(cl->cl_red); #endif } else { - MALLOC(cl, struct priq_class *, sizeof(struct priq_class), + cl = malloc(sizeof(struct priq_class), M_DEVBUF, M_WAITOK); if (cl == NULL) return (NULL); bzero(cl, sizeof(struct priq_class)); - MALLOC(cl->cl_q, class_queue_t *, sizeof(class_queue_t), + cl->cl_q = malloc(sizeof(class_queue_t), M_DEVBUF, M_WAITOK); if (cl->cl_q == NULL) goto err_ret; @@ -397,8 +397,8 @@ priq_class_create(struct priq_if *pif, int pri, int qlimit, int flags, int qid) #endif } if (cl->cl_q != NULL) - FREE(cl->cl_q, M_DEVBUF); - FREE(cl, M_DEVBUF); + free(cl->cl_q, M_DEVBUF); + free(cl, M_DEVBUF); return (NULL); } @@ -447,8 +447,8 @@ priq_class_destroy(struct priq_class *cl) red_destroy(cl->cl_red); #endif } - FREE(cl->cl_q, M_DEVBUF); - FREE(cl, M_DEVBUF); + free(cl->cl_q, M_DEVBUF); + free(cl, M_DEVBUF); return (0); } @@ -666,7 +666,7 @@ priq_attach(ifq, bandwidth) { struct priq_if *pif; - MALLOC(pif, struct priq_if *, sizeof(struct priq_if), + pif = malloc(sizeof(struct priq_if), M_DEVBUF, M_WAITOK); if (pif == NULL) return (NULL); @@ -702,7 +702,7 @@ priq_detach(pif) ASSERT(p != NULL); } - FREE(pif, M_DEVBUF); + free(pif, M_DEVBUF); return (0); } diff --git a/sys/contrib/altq/altq/altq_red.c b/sys/contrib/altq/altq/altq_red.c index f6b7e31..2804cee 100644 --- a/sys/contrib/altq/altq/altq_red.c +++ b/sys/contrib/altq/altq/altq_red.c @@ -233,7 +233,7 @@ red_alloc(int weight, int inv_pmax, int th_min, int th_max, int flags, int w, i; int npkts_per_sec; - MALLOC(rp, red_t *, sizeof(red_t), M_DEVBUF, M_WAITOK); + rp = malloc(sizeof(red_t), M_DEVBUF, M_WAITOK); if (rp == NULL) return (NULL); bzero(rp, sizeof(red_t)); @@ -321,7 +321,7 @@ red_destroy(red_t *rp) #endif #endif /* ALTQ3_COMPAT */ wtab_destroy(rp->red_wtab); - FREE(rp, M_DEVBUF); + free(rp, M_DEVBUF); } void @@ -646,7 +646,7 @@ wtab_alloc(int weight) return (w); } - MALLOC(w, struct wtab *, sizeof(struct wtab), M_DEVBUF, M_WAITOK); + w = malloc(sizeof(struct wtab), M_DEVBUF, M_WAITOK); if (w == NULL) panic("wtab_alloc: malloc failed!"); bzero(w, sizeof(struct wtab)); @@ -682,7 +682,7 @@ wtab_destroy(struct wtab *w) break; } - FREE(w, M_DEVBUF); + free(w, M_DEVBUF); return (0); } @@ -816,17 +816,17 @@ redioctl(dev, cmd, addr, flag, p) } /* allocate and initialize red_queue_t */ - MALLOC(rqp, red_queue_t *, sizeof(red_queue_t), M_DEVBUF, M_WAITOK); + rqp = malloc(sizeof(red_queue_t), M_DEVBUF, M_WAITOK); if (rqp == NULL) { error = ENOMEM; break; } bzero(rqp, sizeof(red_queue_t)); - MALLOC(rqp->rq_q, class_queue_t *, sizeof(class_queue_t), + rqp->rq_q = malloc(sizeof(class_queue_t), M_DEVBUF, M_WAITOK); if (rqp->rq_q == NULL) { - FREE(rqp, M_DEVBUF); + free(rqp, M_DEVBUF); error = ENOMEM; break; } @@ -834,8 +834,8 @@ redioctl(dev, cmd, addr, flag, p) rqp->rq_red = red_alloc(0, 0, 0, 0, 0, 0); if (rqp->rq_red == NULL) { - FREE(rqp->rq_q, M_DEVBUF); - FREE(rqp, M_DEVBUF); + free(rqp->rq_q, M_DEVBUF); + free(rqp, M_DEVBUF); error = ENOMEM; break; } @@ -854,8 +854,8 @@ redioctl(dev, cmd, addr, flag, p) NULL, NULL); if (error) { red_destroy(rqp->rq_red); - FREE(rqp->rq_q, M_DEVBUF); - FREE(rqp, M_DEVBUF); + free(rqp->rq_q, M_DEVBUF); + free(rqp, M_DEVBUF); break; } @@ -1016,8 +1016,8 @@ red_detach(rqp) } red_destroy(rqp->rq_red); - FREE(rqp->rq_q, M_DEVBUF); - FREE(rqp, M_DEVBUF); + free(rqp->rq_q, M_DEVBUF); + free(rqp, M_DEVBUF); return (error); } @@ -1297,16 +1297,16 @@ fv_alloc(rp) int i, num; num = FV_FLOWLISTSIZE; - MALLOC(fv, struct flowvalve *, sizeof(struct flowvalve), + fv = malloc(sizeof(struct flowvalve), M_DEVBUF, M_WAITOK); if (fv == NULL) return (NULL); bzero(fv, sizeof(struct flowvalve)); - MALLOC(fv->fv_fves, struct fve *, sizeof(struct fve) * num, + fv->fv_fves = malloc(sizeof(struct fve) * num, M_DEVBUF, M_WAITOK); if (fv->fv_fves == NULL) { - FREE(fv, M_DEVBUF); + free(fv, M_DEVBUF); return (NULL); } bzero(fv->fv_fves, sizeof(struct fve) * num); @@ -1323,11 +1323,11 @@ fv_alloc(rp) fv->fv_pthresh = (FV_PSCALE(1) << FP_SHIFT) / rp->red_inv_pmax; /* initialize drop rate to fraction table */ - MALLOC(fv->fv_p2ftab, int *, sizeof(int) * BRTT_SIZE, + fv->fv_p2ftab = malloc(sizeof(int) * BRTT_SIZE, M_DEVBUF, M_WAITOK); if (fv->fv_p2ftab == NULL) { - FREE(fv->fv_fves, M_DEVBUF); - FREE(fv, M_DEVBUF); + free(fv->fv_fves, M_DEVBUF); + free(fv, M_DEVBUF); return (NULL); } /* @@ -1348,9 +1348,9 @@ fv_alloc(rp) static void fv_destroy(fv) struct flowvalve *fv; { - FREE(fv->fv_p2ftab, M_DEVBUF); - FREE(fv->fv_fves, M_DEVBUF); - FREE(fv, M_DEVBUF); + free(fv->fv_p2ftab, M_DEVBUF); + free(fv->fv_fves, M_DEVBUF); + free(fv, M_DEVBUF); } static __inline int diff --git a/sys/contrib/altq/altq/altq_rio.c b/sys/contrib/altq/altq/altq_rio.c index a05dba7..09599c2 100644 --- a/sys/contrib/altq/altq/altq_rio.c +++ b/sys/contrib/altq/altq/altq_rio.c @@ -206,7 +206,7 @@ rio_alloc(int weight, struct redparams *params, int flags, int pkttime) int w, i; int npkts_per_sec; - MALLOC(rp, rio_t *, sizeof(rio_t), M_DEVBUF, M_WAITOK); + rp = malloc(sizeof(rio_t), M_DEVBUF, M_WAITOK); if (rp == NULL) return (NULL); bzero(rp, sizeof(rio_t)); @@ -293,7 +293,7 @@ void rio_destroy(rio_t *rp) { wtab_destroy(rp->rio_wtab); - FREE(rp, M_DEVBUF); + free(rp, M_DEVBUF); } void @@ -572,17 +572,17 @@ rioioctl(dev, cmd, addr, flag, p) } /* allocate and initialize rio_queue_t */ - MALLOC(rqp, rio_queue_t *, sizeof(rio_queue_t), M_DEVBUF, M_WAITOK); + rqp = malloc(sizeof(rio_queue_t), M_DEVBUF, M_WAITOK); if (rqp == NULL) { error = ENOMEM; break; } bzero(rqp, sizeof(rio_queue_t)); - MALLOC(rqp->rq_q, class_queue_t *, sizeof(class_queue_t), + rqp->rq_q = malloc(sizeof(class_queue_t), M_DEVBUF, M_WAITOK); if (rqp->rq_q == NULL) { - FREE(rqp, M_DEVBUF); + free(rqp, M_DEVBUF); error = ENOMEM; break; } @@ -590,8 +590,8 @@ rioioctl(dev, cmd, addr, flag, p) rqp->rq_rio = rio_alloc(0, NULL, 0, 0); if (rqp->rq_rio == NULL) { - FREE(rqp->rq_q, M_DEVBUF); - FREE(rqp, M_DEVBUF); + free(rqp->rq_q, M_DEVBUF); + free(rqp, M_DEVBUF); error = ENOMEM; break; } @@ -610,8 +610,8 @@ rioioctl(dev, cmd, addr, flag, p) NULL, NULL); if (error) { rio_destroy(rqp->rq_rio); - FREE(rqp->rq_q, M_DEVBUF); - FREE(rqp, M_DEVBUF); + free(rqp->rq_q, M_DEVBUF); + free(rqp, M_DEVBUF); break; } @@ -759,8 +759,8 @@ rio_detach(rqp) } rio_destroy(rqp->rq_rio); - FREE(rqp->rq_q, M_DEVBUF); - FREE(rqp, M_DEVBUF); + free(rqp->rq_q, M_DEVBUF); + free(rqp, M_DEVBUF); return (error); } diff --git a/sys/contrib/altq/altq/altq_rmclass.c b/sys/contrib/altq/altq/altq_rmclass.c index 63194ee..94c53f1 100644 --- a/sys/contrib/altq/altq/altq_rmclass.c +++ b/sys/contrib/altq/altq/altq_rmclass.c @@ -220,16 +220,16 @@ rmc_newclass(int pri, struct rm_ifdat *ifd, u_int nsecPerByte, } #endif - MALLOC(cl, struct rm_class *, sizeof(struct rm_class), + cl = malloc(sizeof(struct rm_class), M_DEVBUF, M_WAITOK); if (cl == NULL) return (NULL); bzero(cl, sizeof(struct rm_class)); CALLOUT_INIT(&cl->callout_); - MALLOC(cl->q_, class_queue_t *, sizeof(class_queue_t), + cl->q_ = malloc(sizeof(class_queue_t), M_DEVBUF, M_WAITOK); if (cl->q_ == NULL) { - FREE(cl, M_DEVBUF); + free(cl, M_DEVBUF); return (NULL); } bzero(cl->q_, sizeof(class_queue_t)); @@ -658,8 +658,8 @@ rmc_delete_class(struct rm_ifdat *ifd, struct rm_class *cl) red_destroy(cl->red_); #endif } - FREE(cl->q_, M_DEVBUF); - FREE(cl, M_DEVBUF); + free(cl->q_, M_DEVBUF); + free(cl, M_DEVBUF); } diff --git a/sys/contrib/altq/altq/altq_subr.c b/sys/contrib/altq/altq/altq_subr.c index ab945eb..0dd1801 100644 --- a/sys/contrib/altq/altq/altq_subr.c +++ b/sys/contrib/altq/altq/altq_subr.c @@ -397,13 +397,13 @@ tbr_set(ifq, profile) return (ENOENT); } ifq->altq_tbr = NULL; - FREE(tbr, M_DEVBUF); + free(tbr, M_DEVBUF); IFQ_UNLOCK(ifq); return (0); } IFQ_UNLOCK(ifq); - MALLOC(tbr, struct tb_regulator *, sizeof(struct tb_regulator), + tbr = malloc(sizeof(struct tb_regulator), M_DEVBUF, M_WAITOK); if (tbr == NULL) { /* can not happen */ IFQ_UNLOCK(ifq); @@ -426,7 +426,7 @@ tbr_set(ifq, profile) ifq->altq_tbr = tbr; /* set the new tbr */ if (otbr != NULL) - FREE(otbr, M_DEVBUF); + free(otbr, M_DEVBUF); else { if (tbr_timer == 0) { CALLOUT_RESET(&tbr_callout, 1, tbr_timeout, (void *)0); @@ -1402,7 +1402,7 @@ acc_add_filter(classifier, filter, class, phandle) return (EINVAL); #endif - MALLOC(afp, struct acc_filter *, sizeof(struct acc_filter), + afp = malloc(sizeof(struct acc_filter), M_DEVBUF, M_WAITOK); if (afp == NULL) return (ENOMEM); @@ -1529,7 +1529,7 @@ acc_delete_filter(classifier, handle) LIST_REMOVE(afp, f_chain); splx(s); - FREE(afp, M_DEVBUF); + free(afp, M_DEVBUF); /* todo: update filt_bmask */ @@ -1559,7 +1559,7 @@ acc_discard_filters(classifier, class, all) LIST_FOREACH(afp, &classifier->acc_filters[i], f_chain) if (all || afp->f_class == class) { LIST_REMOVE(afp, f_chain); - FREE(afp, M_DEVBUF); + free(afp, M_DEVBUF); /* start again from the head */ break; } @@ -1981,7 +1981,7 @@ ip4f_init(void) TAILQ_INIT(&ip4f_list); for (i=0; i<IP4F_TABSIZE; i++) { - MALLOC(fp, struct ip4_frag *, sizeof(struct ip4_frag), + fp = malloc(sizeof(struct ip4_frag), M_DEVBUF, M_NOWAIT); if (fp == NULL) { printf("ip4f_init: can't alloc %dth entry!\n", i); |