Commit 3130d905ba86d5f2636b2f45d5beefe82cb03df6

Authored by Roman Zippel
Committed by Linus Torvalds
1 parent c28bda2517

m68k: Atari SCSI driver compile fixes

Atari SCSI driver compile fixes

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 3 changed files with 49 additions and 134 deletions Side-by-side Diff

drivers/scsi/atari_NCR5380.c
... ... @@ -272,8 +272,9 @@
272 272 (struct NCR5380_hostdata *)(in)->hostdata
273 273 #define HOSTDATA(in) ((struct NCR5380_hostdata *)(in)->hostdata)
274 274  
275   -#define NEXT(cmd) ((cmd)->host_scribble)
276   -#define NEXTADDR(cmd) ((Scsi_Cmnd **)&((cmd)->host_scribble))
  275 +#define NEXT(cmd) ((Scsi_Cmnd *)(cmd)->host_scribble)
  276 +#define SET_NEXT(cmd,next) ((cmd)->host_scribble = (void *)(next))
  277 +#define NEXTADDR(cmd) ((Scsi_Cmnd **)&(cmd)->host_scribble)
277 278  
278 279 #define HOSTNO instance->host_no
279 280 #define H_NO(cmd) (cmd)->device->host->host_no
... ... @@ -479,7 +480,7 @@
479 480 virt_to_phys(page_address(cmd->SCp.buffer[1].page) +
480 481 cmd->SCp.buffer[1].offset) == endaddr;) {
481 482 MER_PRINTK("VTOP(%p) == %08lx -> merging\n",
482   - cmd->SCp.buffer[1].address, endaddr);
  483 + page_address(cmd->SCp.buffer[1].page), endaddr);
483 484 #if (NDEBUG & NDEBUG_MERGING)
484 485 ++cnt;
485 486 #endif
... ... @@ -1002,7 +1003,7 @@
1002 1003 * in a queue
1003 1004 */
1004 1005  
1005   - NEXT(cmd) = NULL;
  1006 + SET_NEXT(cmd, NULL);
1006 1007 cmd->scsi_done = done;
1007 1008  
1008 1009 cmd->result = 0;
1009 1010  
... ... @@ -1034,14 +1035,14 @@
1034 1035 }
1035 1036 if (!(hostdata->issue_queue) || (cmd->cmnd[0] == REQUEST_SENSE)) {
1036 1037 LIST(cmd, hostdata->issue_queue);
1037   - NEXT(cmd) = hostdata->issue_queue;
  1038 + SET_NEXT(cmd, hostdata->issue_queue);
1038 1039 hostdata->issue_queue = cmd;
1039 1040 } else {
1040 1041 for (tmp = (Scsi_Cmnd *)hostdata->issue_queue;
1041 1042 NEXT(tmp); tmp = NEXT(tmp))
1042 1043 ;
1043 1044 LIST(cmd, tmp);
1044   - NEXT(tmp) = cmd;
  1045 + SET_NEXT(tmp, cmd);
1045 1046 }
1046 1047 local_irq_restore(flags);
1047 1048  
1048 1049  
... ... @@ -1149,12 +1150,12 @@
1149 1150 local_irq_disable();
1150 1151 if (prev) {
1151 1152 REMOVE(prev, NEXT(prev), tmp, NEXT(tmp));
1152   - NEXT(prev) = NEXT(tmp);
  1153 + SET_NEXT(prev, NEXT(tmp));
1153 1154 } else {
1154 1155 REMOVE(-1, hostdata->issue_queue, tmp, NEXT(tmp));
1155 1156 hostdata->issue_queue = NEXT(tmp);
1156 1157 }
1157   - NEXT(tmp) = NULL;
  1158 + SET_NEXT(tmp, NULL);
1158 1159 falcon_dont_release++;
1159 1160  
1160 1161 /* reenable interrupts after finding one */
... ... @@ -1192,7 +1193,7 @@
1192 1193 } else {
1193 1194 local_irq_disable();
1194 1195 LIST(tmp, hostdata->issue_queue);
1195   - NEXT(tmp) = hostdata->issue_queue;
  1196 + SET_NEXT(tmp, hostdata->issue_queue);
1196 1197 hostdata->issue_queue = tmp;
1197 1198 #ifdef SUPPORT_TAGS
1198 1199 cmd_free_tag(tmp);
... ... @@ -2295,7 +2296,7 @@
2295 2296  
2296 2297 local_irq_save(flags);
2297 2298 LIST(cmd,hostdata->issue_queue);
2298   - NEXT(cmd) = hostdata->issue_queue;
  2299 + SET_NEXT(cmd, hostdata->issue_queue);
2299 2300 hostdata->issue_queue = (Scsi_Cmnd *) cmd;
2300 2301 local_irq_restore(flags);
2301 2302 QU_PRINTK("scsi%d: REQUEST SENSE added to head of "
... ... @@ -2357,7 +2358,7 @@
2357 2358 local_irq_save(flags);
2358 2359 cmd->device->disconnect = 1;
2359 2360 LIST(cmd,hostdata->disconnected_queue);
2360   - NEXT(cmd) = hostdata->disconnected_queue;
  2361 + SET_NEXT(cmd, hostdata->disconnected_queue);
2361 2362 hostdata->connected = NULL;
2362 2363 hostdata->disconnected_queue = cmd;
2363 2364 local_irq_restore(flags);
2364 2365  
... ... @@ -2632,12 +2633,12 @@
2632 2633 falcon_dont_release++;
2633 2634 if (prev) {
2634 2635 REMOVE(prev, NEXT(prev), tmp, NEXT(tmp));
2635   - NEXT(prev) = NEXT(tmp);
  2636 + SET_NEXT(prev, NEXT(tmp));
2636 2637 } else {
2637 2638 REMOVE(-1, hostdata->disconnected_queue, tmp, NEXT(tmp));
2638 2639 hostdata->disconnected_queue = NEXT(tmp);
2639 2640 }
2640   - NEXT(tmp) = NULL;
  2641 + SET_NEXT(tmp, NULL);
2641 2642 break;
2642 2643 }
2643 2644 }
... ... @@ -2769,7 +2770,7 @@
2769 2770 if (cmd == tmp) {
2770 2771 REMOVE(5, *prev, tmp, NEXT(tmp));
2771 2772 (*prev) = NEXT(tmp);
2772   - NEXT(tmp) = NULL;
  2773 + SET_NEXT(tmp, NULL);
2773 2774 tmp->result = DID_ABORT << 16;
2774 2775 local_irq_restore(flags);
2775 2776 ABRT_PRINTK("scsi%d: abort removed command from issue queue.\n",
... ... @@ -2844,7 +2845,7 @@
2844 2845 if (cmd == tmp) {
2845 2846 REMOVE(5, *prev, tmp, NEXT(tmp));
2846 2847 *prev = NEXT(tmp);
2847   - NEXT(tmp) = NULL;
  2848 + SET_NEXT(tmp, NULL);
2848 2849 tmp->result = DID_ABORT << 16;
2849 2850 /* We must unlock the tag/LUN immediately here, since the
2850 2851 * target goes to BUS FREE and doesn't send us another
... ... @@ -2965,7 +2966,7 @@
2965 2966  
2966 2967 for (i = 0; (cmd = disconnected_queue); ++i) {
2967 2968 disconnected_queue = NEXT(cmd);
2968   - NEXT(cmd) = NULL;
  2969 + SET_NEXT(cmd, NULL);
2969 2970 cmd->result = (cmd->result & 0xffff) | (DID_RESET << 16);
2970 2971 cmd->scsi_done(cmd);
2971 2972 }
drivers/scsi/atari_scsi.c
... ... @@ -69,9 +69,9 @@
69 69  
70 70 #define NDEBUG (0)
71 71  
72   -#define NDEBUG_ABORT 0x800000
73   -#define NDEBUG_TAGS 0x1000000
74   -#define NDEBUG_MERGING 0x2000000
  72 +#define NDEBUG_ABORT 0x00100000
  73 +#define NDEBUG_TAGS 0x00200000
  74 +#define NDEBUG_MERGING 0x00400000
75 75  
76 76 #define AUTOSENSE
77 77 /* For the Atari version, use only polled IO or REAL_DMA */
drivers/scsi/atari_scsi.h
... ... @@ -113,144 +113,58 @@
113 113 *
114 114 */
115 115  
116   -#if NDEBUG & NDEBUG_ARBITRATION
  116 +#define dprint(flg, format...) \
  117 +({ \
  118 + if (NDEBUG & (flg)) \
  119 + printk(KERN_DEBUG format); \
  120 +})
  121 +
117 122 #define ARB_PRINTK(format, args...) \
118   - printk(KERN_DEBUG format , ## args)
119   -#else
120   -#define ARB_PRINTK(format, args...)
121   -#endif
122   -#if NDEBUG & NDEBUG_AUTOSENSE
  123 + dprint(NDEBUG_ARBITRATION, format , ## args)
123 124 #define ASEN_PRINTK(format, args...) \
124   - printk(KERN_DEBUG format , ## args)
125   -#else
126   -#define ASEN_PRINTK(format, args...)
127   -#endif
128   -#if NDEBUG & NDEBUG_DMA
  125 + dprint(NDEBUG_AUTOSENSE, format , ## args)
129 126 #define DMA_PRINTK(format, args...) \
130   - printk(KERN_DEBUG format , ## args)
131   -#else
132   -#define DMA_PRINTK(format, args...)
133   -#endif
134   -#if NDEBUG & NDEBUG_HANDSHAKE
  127 + dprint(NDEBUG_DMA, format , ## args)
135 128 #define HSH_PRINTK(format, args...) \
136   - printk(KERN_DEBUG format , ## args)
137   -#else
138   -#define HSH_PRINTK(format, args...)
139   -#endif
140   -#if NDEBUG & NDEBUG_INFORMATION
  129 + dprint(NDEBUG_HANDSHAKE, format , ## args)
141 130 #define INF_PRINTK(format, args...) \
142   - printk(KERN_DEBUG format , ## args)
143   -#else
144   -#define INF_PRINTK(format, args...)
145   -#endif
146   -#if NDEBUG & NDEBUG_INIT
  131 + dprint(NDEBUG_INFORMATION, format , ## args)
147 132 #define INI_PRINTK(format, args...) \
148   - printk(KERN_DEBUG format , ## args)
149   -#else
150   -#define INI_PRINTK(format, args...)
151   -#endif
152   -#if NDEBUG & NDEBUG_INTR
  133 + dprint(NDEBUG_INIT, format , ## args)
153 134 #define INT_PRINTK(format, args...) \
154   - printk(KERN_DEBUG format , ## args)
155   -#else
156   -#define INT_PRINTK(format, args...)
157   -#endif
158   -#if NDEBUG & NDEBUG_LINKED
  135 + dprint(NDEBUG_INTR, format , ## args)
159 136 #define LNK_PRINTK(format, args...) \
160   - printk(KERN_DEBUG format , ## args)
161   -#else
162   -#define LNK_PRINTK(format, args...)
163   -#endif
164   -#if NDEBUG & NDEBUG_MAIN
  137 + dprint(NDEBUG_LINKED, format , ## args)
165 138 #define MAIN_PRINTK(format, args...) \
166   - printk(KERN_DEBUG format , ## args)
167   -#else
168   -#define MAIN_PRINTK(format, args...)
169   -#endif
170   -#if NDEBUG & NDEBUG_NO_DATAOUT
  139 + dprint(NDEBUG_MAIN, format , ## args)
171 140 #define NDAT_PRINTK(format, args...) \
172   - printk(KERN_DEBUG format , ## args)
173   -#else
174   -#define NDAT_PRINTK(format, args...)
175   -#endif
176   -#if NDEBUG & NDEBUG_NO_WRITE
  141 + dprint(NDEBUG_NO_DATAOUT, format , ## args)
177 142 #define NWR_PRINTK(format, args...) \
178   - printk(KERN_DEBUG format , ## args)
179   -#else
180   -#define NWR_PRINTK(format, args...)
181   -#endif
182   -#if NDEBUG & NDEBUG_PIO
  143 + dprint(NDEBUG_NO_WRITE, format , ## args)
183 144 #define PIO_PRINTK(format, args...) \
184   - printk(KERN_DEBUG format , ## args)
185   -#else
186   -#define PIO_PRINTK(format, args...)
187   -#endif
188   -#if NDEBUG & NDEBUG_PSEUDO_DMA
  145 + dprint(NDEBUG_PIO, format , ## args)
189 146 #define PDMA_PRINTK(format, args...) \
190   - printk(KERN_DEBUG format , ## args)
191   -#else
192   -#define PDMA_PRINTK(format, args...)
193   -#endif
194   -#if NDEBUG & NDEBUG_QUEUES
  147 + dprint(NDEBUG_PSEUDO_DMA, format , ## args)
195 148 #define QU_PRINTK(format, args...) \
196   - printk(KERN_DEBUG format , ## args)
197   -#else
198   -#define QU_PRINTK(format, args...)
199   -#endif
200   -#if NDEBUG & NDEBUG_RESELECTION
  149 + dprint(NDEBUG_QUEUES, format , ## args)
201 150 #define RSL_PRINTK(format, args...) \
202   - printk(KERN_DEBUG format , ## args)
203   -#else
204   -#define RSL_PRINTK(format, args...)
205   -#endif
206   -#if NDEBUG & NDEBUG_SELECTION
  151 + dprint(NDEBUG_RESELECTION, format , ## args)
207 152 #define SEL_PRINTK(format, args...) \
208   - printk(KERN_DEBUG format , ## args)
209   -#else
210   -#define SEL_PRINTK(format, args...)
211   -#endif
212   -#if NDEBUG & NDEBUG_USLEEP
  153 + dprint(NDEBUG_SELECTION, format , ## args)
213 154 #define USL_PRINTK(format, args...) \
214   - printk(KERN_DEBUG format , ## args)
215   -#else
216   -#define USL_PRINTK(format, args...)
217   -#endif
218   -#if NDEBUG & NDEBUG_LAST_BYTE_SENT
  155 + dprint(NDEBUG_USLEEP, format , ## args)
219 156 #define LBS_PRINTK(format, args...) \
220   - printk(KERN_DEBUG format , ## args)
221   -#else
222   -#define LBS_PRINTK(format, args...)
223   -#endif
224   -#if NDEBUG & NDEBUG_RESTART_SELECT
  157 + dprint(NDEBUG_LAST_BYTE_SENT, format , ## args)
225 158 #define RSS_PRINTK(format, args...) \
226   - printk(KERN_DEBUG format , ## args)
227   -#else
228   -#define RSS_PRINTK(format, args...)
229   -#endif
230   -#if NDEBUG & NDEBUG_EXTENDED
  159 + dprint(NDEBUG_RESTART_SELECT, format , ## args)
231 160 #define EXT_PRINTK(format, args...) \
232   - printk(KERN_DEBUG format , ## args)
233   -#else
234   -#define EXT_PRINTK(format, args...)
235   -#endif
236   -#if NDEBUG & NDEBUG_ABORT
  161 + dprint(NDEBUG_EXTENDED, format , ## args)
237 162 #define ABRT_PRINTK(format, args...) \
238   - printk(KERN_DEBUG format , ## args)
239   -#else
240   -#define ABRT_PRINTK(format, args...)
241   -#endif
242   -#if NDEBUG & NDEBUG_TAGS
  163 + dprint(NDEBUG_ABORT, format , ## args)
243 164 #define TAG_PRINTK(format, args...) \
244   - printk(KERN_DEBUG format , ## args)
245   -#else
246   -#define TAG_PRINTK(format, args...)
247   -#endif
248   -#if NDEBUG & NDEBUG_MERGING
  165 + dprint(NDEBUG_TAGS, format , ## args)
249 166 #define MER_PRINTK(format, args...) \
250   - printk(KERN_DEBUG format , ## args)
251   -#else
252   -#define MER_PRINTK(format, args...)
253   -#endif
  167 + dprint(NDEBUG_MERGING, format , ## args)
254 168  
255 169 /* conditional macros for NCR5380_print_{,phase,status} */
256 170