aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2008-12-29 21:42:33 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-29 21:42:33 -0500
commit684f4a4c4a69f7226d8c7559c0cdfc7bd388335a (patch)
tree7388e9ff9e1bdc60526731b242dc10f8f1a294bb
parent18cc42a3a17d19774b332e933cf34c71b0d3903c (diff)
EtherExpress16: fix printing timed out status
in drivers/net/eexpress.c:558, function unstick_cu() while (!SCB_complete(rsst=scb_status(dev))) { ... if (...) printk(KERN_WARNING "%s: Reset timed out status %04x, retrying...\n", dev->name,rsst); } but this will become while (!((rsst = scb_status(dev) & 0x8000) != 0) ... because of the macro: #define SCB_complete(s) ((s&0x8000)!=0) so rsst can only become either 0x8000 or 0, but in the latter case the loop ends, I think the wrong timed out status is printed. This also cleans up similar macros. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/eexpress.h56
1 files changed, 28 insertions, 28 deletions
diff --git a/drivers/net/eexpress.h b/drivers/net/eexpress.h
index 707df3fcfe40..dc9c6ea289e9 100644
--- a/drivers/net/eexpress.h
+++ b/drivers/net/eexpress.h
@@ -68,17 +68,17 @@
68 */ 68 */
69 69
70/* these functions take the SCB status word and test the relevant status bit */ 70/* these functions take the SCB status word and test the relevant status bit */
71#define SCB_complete(s) ((s&0x8000)!=0) 71#define SCB_complete(s) (((s) & 0x8000) != 0)
72#define SCB_rxdframe(s) ((s&0x4000)!=0) 72#define SCB_rxdframe(s) (((s) & 0x4000) != 0)
73#define SCB_CUdead(s) ((s&0x2000)!=0) 73#define SCB_CUdead(s) (((s) & 0x2000) != 0)
74#define SCB_RUdead(s) ((s&0x1000)!=0) 74#define SCB_RUdead(s) (((s) & 0x1000) != 0)
75#define SCB_ack(s) (s & 0xf000) 75#define SCB_ack(s) ((s) & 0xf000)
76 76
77/* Command unit status: 0=idle, 1=suspended, 2=active */ 77/* Command unit status: 0=idle, 1=suspended, 2=active */
78#define SCB_CUstat(s) ((s&0x0300)>>8) 78#define SCB_CUstat(s) (((s)&0x0300)>>8)
79 79
80/* Receive unit status: 0=idle, 1=suspended, 2=out of resources, 4=ready */ 80/* Receive unit status: 0=idle, 1=suspended, 2=out of resources, 4=ready */
81#define SCB_RUstat(s) ((s&0x0070)>>4) 81#define SCB_RUstat(s) (((s)&0x0070)>>4)
82 82
83/* SCB commands */ 83/* SCB commands */
84#define SCB_CUnop 0x0000 84#define SCB_CUnop 0x0000
@@ -98,18 +98,18 @@
98 * Command block defines 98 * Command block defines
99 */ 99 */
100 100
101#define Stat_Done(s) ((s&0x8000)!=0) 101#define Stat_Done(s) (((s) & 0x8000) != 0)
102#define Stat_Busy(s) ((s&0x4000)!=0) 102#define Stat_Busy(s) (((s) & 0x4000) != 0)
103#define Stat_OK(s) ((s&0x2000)!=0) 103#define Stat_OK(s) (((s) & 0x2000) != 0)
104#define Stat_Abort(s) ((s&0x1000)!=0) 104#define Stat_Abort(s) (((s) & 0x1000) != 0)
105#define Stat_STFail ((s&0x0800)!=0) 105#define Stat_STFail (((s) & 0x0800) != 0)
106#define Stat_TNoCar(s) ((s&0x0400)!=0) 106#define Stat_TNoCar(s) (((s) & 0x0400) != 0)
107#define Stat_TNoCTS(s) ((s&0x0200)!=0) 107#define Stat_TNoCTS(s) (((s) & 0x0200) != 0)
108#define Stat_TNoDMA(s) ((s&0x0100)!=0) 108#define Stat_TNoDMA(s) (((s) & 0x0100) != 0)
109#define Stat_TDefer(s) ((s&0x0080)!=0) 109#define Stat_TDefer(s) (((s) & 0x0080) != 0)
110#define Stat_TColl(s) ((s&0x0040)!=0) 110#define Stat_TColl(s) (((s) & 0x0040) != 0)
111#define Stat_TXColl(s) ((s&0x0020)!=0) 111#define Stat_TXColl(s) (((s) & 0x0020) != 0)
112#define Stat_NoColl(s) (s&0x000f) 112#define Stat_NoColl(s) ((s) & 0x000f)
113 113
114/* Cmd_END will end AFTER the command if this is the first 114/* Cmd_END will end AFTER the command if this is the first
115 * command block after an SCB_CUstart, but BEFORE the command 115 * command block after an SCB_CUstart, but BEFORE the command
@@ -136,16 +136,16 @@
136 * Frame Descriptor (Receive block) defines 136 * Frame Descriptor (Receive block) defines
137 */ 137 */
138 138
139#define FD_Done(s) ((s&0x8000)!=0) 139#define FD_Done(s) (((s) & 0x8000) != 0)
140#define FD_Busy(s) ((s&0x4000)!=0) 140#define FD_Busy(s) (((s) & 0x4000) != 0)
141#define FD_OK(s) ((s&0x2000)!=0) 141#define FD_OK(s) (((s) & 0x2000) != 0)
142 142
143#define FD_CRC(s) ((s&0x0800)!=0) 143#define FD_CRC(s) (((s) & 0x0800) != 0)
144#define FD_Align(s) ((s&0x0400)!=0) 144#define FD_Align(s) (((s) & 0x0400) != 0)
145#define FD_Resrc(s) ((s&0x0200)!=0) 145#define FD_Resrc(s) (((s) & 0x0200) != 0)
146#define FD_DMA(s) ((s&0x0100)!=0) 146#define FD_DMA(s) (((s) & 0x0100) != 0)
147#define FD_Short(s) ((s&0x0080)!=0) 147#define FD_Short(s) (((s) & 0x0080) != 0)
148#define FD_NoEOF(s) ((s&0x0040)!=0) 148#define FD_NoEOF(s) (((s) & 0x0040) != 0)
149 149
150struct rfd_header { 150struct rfd_header {
151 volatile unsigned long flags; 151 volatile unsigned long flags;