diff options
author | luigi <luigi@FreeBSD.org> | 2016-01-26 23:36:18 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2016-01-26 23:36:18 +0000 |
commit | 5e7533603b9c96251039bf574fbaff037ebb2d8b (patch) | |
tree | 5c71b68ffdfcf0a696b0fac4d2e927d231184067 /sys/netpfil | |
parent | 17af12dfee178c781ceb88ace4ccddb8595478bb (diff) | |
download | FreeBSD-src-5e7533603b9c96251039bf574fbaff037ebb2d8b.zip FreeBSD-src-5e7533603b9c96251039bf574fbaff037ebb2d8b.tar.gz |
fix various warnings (signed/unsigned, printf types, unused arguments)
Diffstat (limited to 'sys/netpfil')
-rw-r--r-- | sys/netpfil/ipfw/dn_sched_qfq.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/sys/netpfil/ipfw/dn_sched_qfq.c b/sys/netpfil/ipfw/dn_sched_qfq.c index b5f4bba..02e2d8e 100644 --- a/sys/netpfil/ipfw/dn_sched_qfq.c +++ b/sys/netpfil/ipfw/dn_sched_qfq.c @@ -48,6 +48,7 @@ #endif #ifdef QFQ_DEBUG +#define _P64 unsigned long long /* cast for printing uint64_t */ struct qfq_sched; static void dump_sched(struct qfq_sched *q, const char *msg); #define NO(x) x @@ -84,19 +85,19 @@ static inline unsigned long __fls(unsigned long word) #if !defined(_KERNEL) || !defined(__linux__) #ifdef QFQ_DEBUG -int test_bit(int ix, bitmap *p) +static int test_bit(int ix, bitmap *p) { if (ix < 0 || ix > 31) D("bad index %d", ix); return *p & (1<<ix); } -void __set_bit(int ix, bitmap *p) +static void __set_bit(int ix, bitmap *p) { if (ix < 0 || ix > 31) D("bad index %d", ix); *p |= (1<<ix); } -void __clear_bit(int ix, bitmap *p) +static void __clear_bit(int ix, bitmap *p) { if (ix < 0 || ix > 31) D("bad index %d", ix); @@ -230,9 +231,9 @@ struct qfq_sched { uint64_t V; /* Precise virtual time. */ uint32_t wsum; /* weight sum */ uint32_t iwsum; /* inverse weight sum */ - NO(uint32_t i_wsum; /* ONE_FP/w_sum */ - uint32_t _queued; /* debugging */ - uint32_t loops; /* debugging */) + NO(uint32_t i_wsum;) /* ONE_FP/w_sum */ + NO(uint32_t queued;) /* debugging */ + NO(uint32_t loops;) /* debugging */ bitmap bitmaps[QFQ_MAX_STATE]; /* Group bitmaps. */ struct qfq_group groups[QFQ_MAX_INDEX + 1]; /* The groups. */ }; @@ -486,6 +487,7 @@ qfq_slot_rotate(struct qfq_sched *q, struct qfq_group *grp, uint64_t roundedS) { unsigned int i = (grp->S - roundedS) >> grp->slot_shift; + (void)q; grp->full_slots <<= i; grp->front = (grp->front - i) % QFQ_MAX_SLOTS; } @@ -516,6 +518,7 @@ qfq_update_class(struct qfq_sched *q, struct qfq_group *grp, struct qfq_class *cl) { + (void)q; cl->S = cl->F; if (cl->_q.mq.head == NULL) { qfq_front_slot_remove(grp); @@ -853,9 +856,9 @@ dump_groups(struct qfq_sched *q, uint32_t mask) if (g->slots[j]) D(" bucket %d %p", j, g->slots[j]); } - D("full_slots 0x%x", g->full_slots); + D("full_slots 0x%llx", (_P64)g->full_slots); D(" %2d S 0x%20llx F 0x%llx %c", i, - g->S, g->F, + (_P64)g->S, (_P64)g->F, mask & (1<<i) ? '1' : '0'); } } @@ -864,11 +867,11 @@ static void dump_sched(struct qfq_sched *q, const char *msg) { D("--- in %s: ---", msg); - ND("loops %d queued %d V 0x%llx", q->loops, q->queued, q->V); - D(" ER 0x%08x", q->bitmaps[ER]); - D(" EB 0x%08x", q->bitmaps[EB]); - D(" IR 0x%08x", q->bitmaps[IR]); - D(" IB 0x%08x", q->bitmaps[IB]); + D("loops %d queued %d V 0x%llx", q->loops, q->queued, (_P64)q->V); + D(" ER 0x%08x", (unsigned)q->bitmaps[ER]); + D(" EB 0x%08x", (unsigned)q->bitmaps[EB]); + D(" IR 0x%08x", (unsigned)q->bitmaps[IR]); + D(" IB 0x%08x", (unsigned)q->bitmaps[IB]); dump_groups(q, 0xffffffff); }; #endif /* QFQ_DEBUG */ |