From 3df5ee60f1ee559b1417397461891f8b483e8089 Mon Sep 17 00:00:00 2001 From: "John W. Linville" Date: Thu, 1 May 2008 17:07:32 -0400 Subject: [PATCH] wireless: fix warning introduced by "mac80211: QoS related cleanups" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit net/mac80211/wme.c: In function ‘wme_qdiscop_enqueue’: net/mac80211/wme.c:219: warning: comparison is always false due to limited range of data type drivers/net/wireless/p54/p54common.c: In function ‘p54_conf_tx’: drivers/net/wireless/p54/p54common.c:947: warning: comparison is always false due to limited range of data type Signed-off-by: John W. Linville --- drivers/net/wireless/p54/p54common.c | 2 +- net/mac80211/wme.c | 23 +++++++++-------------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index 34b91ccd8aec..33d608a60d79 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c @@ -944,7 +944,7 @@ static int p54_conf_tx(struct ieee80211_hw *dev, u16 queue, vdcf = (struct p54_tx_control_vdcf *)(((struct p54_control_hdr *) ((void *)priv->cached_vdcf + priv->tx_hdr_len))->data); - if ((params) && !((queue < 0) || (queue > 4))) { + if ((params) && !(queue > 4)) { P54_SET_QUEUE(vdcf->queue[queue], params->aifs, params->cw_min, params->cw_max, params->txop); } else diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index 5eddf1f32ed9..b1e20ca03ffe 100644 --- a/net/mac80211/wme.c +++ b/net/mac80211/wme.c @@ -216,20 +216,15 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd) rcu_read_unlock(); } - if (unlikely(queue < 0)) { - kfree_skb(skb); - err = NET_XMIT_DROP; - } else { - tid = skb->priority & QOS_CONTROL_TAG1D_MASK; - pkt_data->queue = (unsigned int) queue; - qdisc = q->queues[queue]; - err = qdisc->enqueue(skb, qdisc); - if (err == NET_XMIT_SUCCESS) { - qd->q.qlen++; - qd->bstats.bytes += skb->len; - qd->bstats.packets++; - return NET_XMIT_SUCCESS; - } + tid = skb->priority & QOS_CONTROL_TAG1D_MASK; + pkt_data->queue = (unsigned int) queue; + qdisc = q->queues[queue]; + err = qdisc->enqueue(skb, qdisc); + if (err == NET_XMIT_SUCCESS) { + qd->q.qlen++; + qd->bstats.bytes += skb->len; + qd->bstats.packets++; + return NET_XMIT_SUCCESS; } qd->qstats.drops++; return err;