mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gaston Gonzalez <gascoar@gmail.com>
To: gregkh@linuxfoundation.org
Cc: cristina.opriceana@gmail.com, gdonald@gmail.com,
	hamohammed.sa@gmail.com, mahfouz.saif.elyazal@gmail.com,
	paul.gortmaker@windriver.com, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org, gascoar@gmail.com
Subject: [PATCH] staging: rtl8192u: ieee80211: Fix incorrect type in assignment
Date: Sun, 14 Jun 2015 19:59:34 -0300	[thread overview]
Message-ID: <1434322774-30194-1-git-send-email-gascoar@gmail.com> (raw)

Added le16_to_cpu() conversion fixing the following warning in assignment detected by sparse: 

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2157:30: warning: invalid assignment: +=
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2157:30:    left side has type unsigned long
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2157:30:    right side has type restricted __le16

Signed-off-by: Gaston Gonzalez <gascoar@gmail.com>
---
 I wonder if this is the best approach, making payload_size u16 in ieee80211.h would fix this plus other three sparse warnings. Could we make payload_size u16 or it must be definitely le16?

 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 5fbade4..1b11acb 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -2154,7 +2154,7 @@ void ieee80211_softmac_xmit(struct ieee80211_txb *txb, struct ieee80211_device *
 	ieee80211_sta_wakeup(ieee, 0);
 
 	/* update the tx status */
-	ieee->stats.tx_bytes += txb->payload_size;
+	ieee->stats.tx_bytes += le16_to_cpu(txb->payload_size);
 	ieee->stats.tx_packets++;
 	tcb_desc = (cb_desc *)(txb->fragments[0]->cb + MAX_DEV_ADDR_SIZE);
 	if (tcb_desc->bMulticast) {
-- 
2.4.2


                 reply	other threads:[~2015-06-14 23:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1434322774-30194-1-git-send-email-gascoar@gmail.com \
    --to=gascoar@gmail.com \
    --cc=cristina.opriceana@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gdonald@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mahfouz.saif.elyazal@gmail.com \
    --cc=paul.gortmaker@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®