This patch fixes the following sparse warning in r8180_core.c - warning:
restricted __le16 degrades to integer. Also, the variable morefrag is
changed to bool as it is being used as a bool.
Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Reviewed-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
int mode;
struct ieee80211_hdr_3addr *h = (struct ieee80211_hdr_3addr *)skb->data;
- short morefrag = (h->frame_control) & IEEE80211_FCTL_MOREFRAGS;
+ bool morefrag = le16_to_cpu(h->frame_control) & IEEE80211_FCTL_MOREFRAGS;
unsigned long flags;
int priority;
TxDescDuration = ThisFrameTime + aSifsTime + AckTime;
}
- if (!(frag_hdr->frame_control & IEEE80211_FCTL_MOREFRAGS)) {
+ if (!(le16_to_cpu(frag_hdr->frame_control) & IEEE80211_FCTL_MOREFRAGS)) {
/* ThisFrame-ACK. */
Duration = aSifsTime + AckTime;
} else { /* One or more fragments remained. */