Skip to contentSkip to conversation

clean up drivers/scsi/scsi.h

PATCH In review Rolf Eike Beer 2 participants 3 messages Feb 14, 2005 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clean up drivers/scsi/scsi.h

Hi,

this patch removes some useless struct declarations from drivers/scsi/scsi.h. All this structs are already defined in the header files included above except Scsi_Host, for which we now directly include <scsi/scsi_host.h>

drivers/scsi/scsi.h-new renamed from drivers/scsi/scsi.h +1 -6
@@ -28,6 +28,7 @@
 #include <scsi/scsi_eh.h>
 #include <scsi/scsi_request.h>
 #include <scsi/scsi_tcq.h>
+#include <scsi/scsi_host.h>
 #include <scsi/scsi.h>
 
 /*
@@ -40,12 +41,6 @@
 #define FALSE 0
 #endif
 
-struct Scsi_Host;
-struct scsi_cmnd;
-struct scsi_device;
-struct scsi_target;
-struct scatterlist;
-
 /*
  * Legacy dma direction interfaces.
  *
#1 lore raw
Quoted 5 lines · Rolf Eike Beer

Hi,

this patch removes some useless struct declarations from drivers/scsi/scsi.h. All this structs are already defined in the header files included above except Scsi_Host, for which we now directly include <scsi/scsi_host.h>

No, this is totally wrong. If you only use pointers to structs always use forward declarations instead of pulling in a full header.

#2 lore raw

Am Montag, 14. Februar 2005 12:09 schrieb Christoph Hellwig:

Quoted 10 lines · Rolf Eike Beer
Quoted 6 lines

Hi,

this patch removes some useless struct declarations from drivers/scsi/scsi.h. All this structs are already defined in the header files included above except Scsi_Host, for which we now directly include <scsi/scsi_host.h>

No, this is totally wrong. If you only use pointers to structs always use forward declarations instead of pulling in a full header.

Ok, this time without include scsi/scsi_host.h. The rest remains untouched, "struct Scsi_Host;" is also in scsi/scsi_device.h. The header files for all other structs are already included so no need do declare them again.

drivers/scsi/scsi.h-new renamed from drivers/scsi/scsi.h +0 -6
@@ -40,12 +40,6 @@
 #define FALSE 0
 #endif
 
-struct Scsi_Host;
-struct scsi_cmnd;
-struct scsi_device;
-struct scsi_target;
-struct scatterlist;
-
 /*
  * Legacy dma direction interfaces.
  *