svn commit: r294858 - head/sys/netpfil/ipfw
Luigi Rizzo
luigi at FreeBSD.org
Tue Jan 26 23:36:19 UTC 2016
Author: luigi
Date: Tue Jan 26 23:36:18 2016
New Revision: 294858
URL: https://svnweb.freebsd.org/changeset/base/294858
Log:
fix various warnings (signed/unsigned, printf types, unused arguments)
Modified:
head/sys/netpfil/ipfw/dn_sched_qfq.c
Modified: head/sys/netpfil/ipfw/dn_sched_qfq.c
==============================================================================
--- head/sys/netpfil/ipfw/dn_sched_qfq.c Tue Jan 26 22:46:58 2016 (r294857)
+++ head/sys/netpfil/ipfw/dn_sched_qfq.c Tue Jan 26 23:36:18 2016 (r294858)
@@ -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(unsign
#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, str
{
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, st
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_
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 */
More information about the svn-src-all
mailing list