提交 325b70c2 编写于 作者: O Oliver Neukum 提交者: Greg Kroah-Hartman

USB: fix endianness in mos7720

there's code unclean w.r.t. endianness in the mos7720 driver.
Signed-off-by: NOliver Neukum <oneukum@suse.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 1b55fa2d
...@@ -103,11 +103,9 @@ static void mos7720_interrupt_callback(struct urb *urb) ...@@ -103,11 +103,9 @@ static void mos7720_interrupt_callback(struct urb *urb)
{ {
int result; int result;
int length; int length;
__u32 *data; __u8 *data;
unsigned int status;
__u8 sp1; __u8 sp1;
__u8 sp2; __u8 sp2;
__u8 st;
dbg("%s"," : Entering\n"); dbg("%s"," : Entering\n");
...@@ -141,18 +139,19 @@ static void mos7720_interrupt_callback(struct urb *urb) ...@@ -141,18 +139,19 @@ static void mos7720_interrupt_callback(struct urb *urb)
* Byte 2 IIR Port 2 (port.number is 1) * Byte 2 IIR Port 2 (port.number is 1)
* Byte 3 -------------- * Byte 3 --------------
* Byte 4 FIFO status for both */ * Byte 4 FIFO status for both */
if (length && length > 4) {
/* the above description is inverted
* oneukum 2007-03-14 */
if (unlikely(length != 4)) {
dbg("Wrong data !!!"); dbg("Wrong data !!!");
return; return;
} }
status = *data; sp1 = data[3];
sp2 = data[2];
sp1 = (status & 0xff000000)>>24;
sp2 = (status & 0x00ff0000)>>16;
st = status & 0x000000ff;
if ((sp1 & 0x01) || (sp2 & 0x01)) { if ((sp1 | sp2) & 0x01) {
/* No Interrupt Pending in both the ports */ /* No Interrupt Pending in both the ports */
dbg("No Interrupt !!!"); dbg("No Interrupt !!!");
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册