Netdev List
 help / color / mirror / Atom feed
From: Hayes Wang <hayeswang@realtek.com>
To: <netdev@vger.kernel.org>
Cc: <nic_swsd@realtek.com>, <linux-kernel@vger.kernel.org>,
	<linux-usb@vger.kernel.org>, Hayes Wang <hayeswang@realtek.com>
Subject: [PATCH net v3 4/4] r8152: fix incorrect type in assignment
Date: Fri, 15 Nov 2013 15:57:59 +0800	[thread overview]
Message-ID: <1384502279-9959-5-git-send-email-hayeswang@realtek.com> (raw)
In-Reply-To: <1384502279-9959-1-git-send-email-hayeswang@realtek.com>

The data from the hardware should be little endian. Correct the
declaration.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
 drivers/net/usb/r8152.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 81a4171..25e8fa8 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -307,22 +307,22 @@ enum rtl8152_flags {
 #define MCU_TYPE_USB			0x0000
 
 struct rx_desc {
-	u32 opts1;
+	__le32 opts1;
 #define RX_LEN_MASK			0x7fff
-	u32 opts2;
-	u32 opts3;
-	u32 opts4;
-	u32 opts5;
-	u32 opts6;
+	__le32 opts2;
+	__le32 opts3;
+	__le32 opts4;
+	__le32 opts5;
+	__le32 opts6;
 };
 
 struct tx_desc {
-	u32 opts1;
+	__le32 opts1;
 #define TX_FS			(1 << 31) /* First segment of a packet */
 #define TX_LS			(1 << 30) /* Final segment of a packet */
 #define TX_LEN_MASK		0x3ffff
 
-	u32 opts2;
+	__le32 opts2;
 #define UDP_CS			(1 << 31) /* Calculate UDP/IP checksum */
 #define TCP_CS			(1 << 30) /* Calculate TCP/IP checksum */
 #define IPV4_CS			(1 << 29) /* Calculate IPv4 checksum */
@@ -877,7 +877,7 @@ static void write_bulk_callback(struct urb *urb)
 static void intr_callback(struct urb *urb)
 {
 	struct r8152 *tp;
-	__u16 *d;
+	__le16 *d;
 	int status = urb->status;
 	int res;
 
-- 
1.8.3.1

  parent reply	other threads:[~2013-11-15  7:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-15  7:57 [PATCH net v3 0/4] r8152 bug fixes Hayes Wang
2013-11-15  7:57 ` [PATCH net v3 1/4] r8152: fix tx/rx memory overflow Hayes Wang
2013-11-15 22:39   ` David Miller
     [not found]     ` <20131115.173948.1712849813995511721.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2013-11-19  2:32       ` hayeswang
     [not found] ` <1384502279-9959-1-git-send-email-hayeswang-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org>
2013-11-15  7:57   ` [PATCH net v3 2/4] r8152: modify the tx flow Hayes Wang
2013-11-15  7:57   ` [PATCH net v3 3/4] r8152: support stopping/waking tx queue Hayes Wang
2013-11-15  7:57 ` Hayes Wang [this message]
2013-11-19  3:25 ` [PATCH net v4 0/4] r8152 bug fixes Hayes Wang
     [not found]   ` <1384831511-1625-1-git-send-email-hayeswang-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org>
2013-11-19  3:25     ` [PATCH net v4 1/4] r8152: fix tx/rx memory overflow Hayes Wang
2013-11-19  3:25   ` [PATCH net v4 2/4] r8152: modify the tx flow Hayes Wang
2013-11-19  3:25   ` [PATCH net v4 3/4] r8152: support stopping/waking tx queue Hayes Wang
     [not found]     ` <1384831511-1625-4-git-send-email-hayeswang-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org>
2013-11-19 20:25       ` David Miller
     [not found]         ` <20131119.152536.146706009595105149.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2013-11-20  3:28           ` hayeswang
     [not found]             ` <9C2E97E7BED9426ABE0FF4F63E12E33D-Rasf1IRRPZGoECsaD+WFmw@public.gmane.org>
2013-11-20  5:22               ` David Miller
2013-11-20  6:30                 ` hayeswang
2013-11-19  3:25   ` [PATCH net v4 4/4] r8152: fix incorrect type in assignment Hayes Wang
2013-11-20  9:30 ` [PATCH net v5 0/4] r8152 bug fixes Hayes Wang
2013-11-20  9:30   ` [PATCH net v5 1/4] r8152: fix tx/rx memory overflow Hayes Wang
2013-11-20  9:30   ` [PATCH net v5 2/4] r8152: modify the tx flow Hayes Wang
2013-11-20  9:30   ` [PATCH net v5 3/4] r8152: support stopping/waking tx queue Hayes Wang
2013-11-20  9:30   ` [PATCH net v5 4/4] r8152: fix incorrect type in assignment Hayes Wang
2013-12-23  2:20   ` [PATCH net v5 0/4] r8152 bug fixes hayeswang

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=1384502279-9959-5-git-send-email-hayeswang@realtek.com \
    --to=hayeswang@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.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