Skip to contentSkip to conversation

warning cleanup for drivers_scsi_qla1280.c

TRIVIAL Rusty Trivial Russell 3 participants 5 messages Aug 7, 2002 – Aug 8, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

[ Removes the unused warning, and since qla1280_do_dpc is only called when
version < 2.1.95 anyway, makes the whole thing conditional ]

From: Eric Sandeen <[email protected]>

drivers/scsi/qla1280.c renamed from drivers/scsi/qla1280.c.orig +4 -9
@@ -312,7 +312,9 @@
 STATIC int qla1280_return_status( sts_entry_t *sts, Scsi_Cmnd       *cp);
 STATIC void qla1280_removeq(scsi_lu_t *q, srb_t *sp);
 STATIC void qla1280_mem_free(scsi_qla_host_t *ha);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95)
 static void qla1280_do_dpc(void *p);
+#endif
 #ifdef  QLA1280_UNUSED 
 static void qla1280_set_flags(char * s);
 #endif
@@ -1611,17 +1613,12 @@
  * "host->can_queue". This can cause a panic if we were in our interrupt
  * code .
  **************************************************************************/
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95)
 static void qla1280_do_dpc(void *p)
 {
     scsi_qla_host_t *ha = (scsi_qla_host_t *) p;
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,95)
-    unsigned long cpu_flags = 0;
-#endif
 
     COMTRACE('p')  
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,95)
-    spin_lock_irqsave(&io_request_lock, cpu_flags);
-#endif
     if (ha->flags.isp_abort_needed)
         qla1280_abort_isp(ha);
 
@@ -1631,10 +1628,8 @@
     if (ha->done_q_first)
         qla1280_done(ha, (srb_t **)&ha->done_q_first, (srb_t **)&ha->done_q_last);
     ha->flags.dpc_sched = FALSE;
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,95)
-    spin_unlock_irqrestore(&io_request_lock, cpu_flags);
-#endif
 }
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) */
 
 /**************************************************************************
  *   qla1280_device_queue_depth
Signature · 1 line
  Don't blame me: the Monkey is driving
#2 lore raw
In reply to Alan Cox
Quoted 3 lines · Alan Cox

General policy - rip out version ifdefs unless the driver has a maintainer who actively objects ?

Hi Alan,

When I worked for LSI, and was actively maintaining drivers/message/fusion/... code, we had a single set of driver source code that compiled and ran across lots of linux kernels (2.2.5 thru 2.4.19). Most of the version-specific #ifdef's were isolated to one header file (linux_compat.h). We then also had a set of patch files (each pretty small) that could be applied against any explicit kernel (in the supported range). A customer could then (in theory:-) download one set of driver source (including the patch file sets), untar/overlay it, apply a single patch file, and then compile+run the drivers on any of those kernels.

So just curious, are you saying that you'd rather have driver maintainers maintain a separate set of driver source for each explicit kernel (with no version-specific #ifdef's) vs. the way we did it above?

Thanks,
-SteveR

#1 lore raw
In reply to Rusty Trivial Russell
Quoted 3 lines · Rusty Trivial Russell

[ Removes the unused warning, and since qla1280_do_dpc is only called when
version < 2.1.95 anyway, makes the whole thing conditional ]

General policy - rip out version ifdefs unless the driver has a maintainer who actively objects ?

#3 lore raw
In reply to Steve Ralston
Quoted 9 lines · Steve Ralston
Quoted 3 lines · Alan Cox

General policy - rip out version ifdefs unless the driver has a maintainer who actively objects ?

So just curious, are you saying that you'd rather have driver maintainers maintain a separate set of driver source for each explicit kernel (with no version-specific #ifdef's) vs. the way we did it above?

If someone is maintaining them all then there are cases it makes sense to leave the ifdefs in. Thats why I said about maintainers who actively object. I suspect Deanna would also want the MPT fusion ifdefs left in for example

#4 lore raw
In reply to Alan Cox

In message <[email protected]> you write :

Quoted 7 lines · Rusty Trivial Russell
Quoted 3 lines

[ Removes the unused warning, and since qla1280_do_dpc is only called when
version < 2.1.95 anyway, makes the whole thing conditional ]

General policy - rip out version ifdefs unless the driver has a maintainer who actively objects ?

Hm, I wouldn't accept a patch to Trivial which just ripped them out. If it was part of a larger cleanup, then sure. In this case it doesn't change code, it just simplifies it as well as the easiest way of fixing the warning.

Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.