* [2.6 patch] drivers/scsi/scsi_error.c should #include "scsi_transport_api.h"
@ 2006-11-29 10:04 Adrian Bunk
2006-11-29 13:16 ` Matthew Wilcox
0 siblings, 1 reply; 6+ messages in thread
From: Adrian Bunk @ 2006-11-29 10:04 UTC (permalink / raw)
To: James.Bottomley; +Cc: linux-scsi, linux-kernel
Every file should #include the headers containing the prototypes for
its global functions.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
--- linux-2.6.19-rc6-mm2/drivers/scsi/scsi_error.c.old 2006-11-29 09:58:41.000000000 +0100
+++ linux-2.6.19-rc6-mm2/drivers/scsi/scsi_error.c 2006-11-29 09:58:58.000000000 +0100
@@ -36,6 +36,7 @@
#include "scsi_priv.h"
#include "scsi_logging.h"
+#include "scsi_transport_api.h"
#define SENSE_TIMEOUT (10*HZ)
#define START_UNIT_TIMEOUT (30*HZ)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [2.6 patch] drivers/scsi/scsi_error.c should #include "scsi_transport_api.h"
2006-11-29 10:04 Adrian Bunk
@ 2006-11-29 13:16 ` Matthew Wilcox
2006-11-29 14:13 ` James Smart
2007-01-02 11:11 ` Christoph Hellwig
0 siblings, 2 replies; 6+ messages in thread
From: Matthew Wilcox @ 2006-11-29 13:16 UTC (permalink / raw)
To: Adrian Bunk; +Cc: James.Bottomley, linux-scsi, linux-kernel
On Wed, Nov 29, 2006 at 11:04:22AM +0100, Adrian Bunk wrote:
> +#include "scsi_transport_api.h"
scsi_transport_api.h is a weird little file. It's not included by
anything in the drivers/scsi directory, only
drivers/scsi/libsas/sas_scsi_host.c:#include "../scsi_transport_api.h"
drivers/ata/libata-eh.c:#include "../scsi/scsi_transport_api.h"
To me, that says it should be living in include/scsi/ somewhere ...
maybe just put the one function prototype into scsi_eh.h?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [2.6 patch] drivers/scsi/scsi_error.c should #include "scsi_transport_api.h"
2006-11-29 13:16 ` Matthew Wilcox
@ 2006-11-29 14:13 ` James Smart
2006-11-29 14:32 ` Matthew Wilcox
2007-01-02 11:11 ` Christoph Hellwig
1 sibling, 1 reply; 6+ messages in thread
From: James Smart @ 2006-11-29 14:13 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: Adrian Bunk, James.Bottomley, linux-scsi, linux-kernel
Matthew Wilcox wrote:
> On Wed, Nov 29, 2006 at 11:04:22AM +0100, Adrian Bunk wrote:
>> +#include "scsi_transport_api.h"
>
> scsi_transport_api.h is a weird little file. It's not included by
> anything in the drivers/scsi directory, only
> drivers/scsi/libsas/sas_scsi_host.c:#include "../scsi_transport_api.h"
> drivers/ata/libata-eh.c:#include "../scsi/scsi_transport_api.h"
>
> To me, that says it should be living in include/scsi/ somewhere ...
> maybe just put the one function prototype into scsi_eh.h?
would it only go in include/scsi if it intends to be an exported
api for LLDD's and/or user apps ? and stay in drivers/scsi if its
an internal api within the scsi subsystem itself ?
Based on who uses it, I would say its internal right now.
-- james s
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [2.6 patch] drivers/scsi/scsi_error.c should #include "scsi_transport_api.h"
2006-11-29 14:13 ` James Smart
@ 2006-11-29 14:32 ` Matthew Wilcox
0 siblings, 0 replies; 6+ messages in thread
From: Matthew Wilcox @ 2006-11-29 14:32 UTC (permalink / raw)
To: James Smart; +Cc: Adrian Bunk, James.Bottomley, linux-scsi, linux-kernel
On Wed, Nov 29, 2006 at 09:13:35AM -0500, James Smart wrote:
> would it only go in include/scsi if it intends to be an exported
> api for LLDD's and/or user apps ? and stay in drivers/scsi if its
> an internal api within the scsi subsystem itself ?
It isn't clear to me that's the intended use of include/scsi. If it is,
it's already being violated, eg by
$ find * -type f |xargs grep scsi_host_scan_allowed
drivers/scsi/scsi_scan.c: if (scsi_host_scan_allowed(shost))
drivers/scsi/scsi_scan.c: if (scsi_host_scan_allowed(shost))
drivers/scsi/scsi_scan.c: if (scsi_host_scan_allowed(shost)) {
drivers/scsi/scsi_scan.c: if (!scsi_host_scan_allowed(shost))
include/scsi/scsi_host.h: * scsi_host_scan_allowed - Is scanning of this
host allowed
include/scsi/scsi_host.h:static inline int scsi_host_scan_allowed(struct
Scsi_Host *shost)
(a good candidate to be moved to scsi_scan.c, in fact!)
scsi_host_state_name, scsi_normalize_sense, scsi_reset_provider,
scsi_test_unit_ready, scsi_put_command are all in similar usage to
scsi_schedule_eh. There's probably more, I just picked some likely
looking candidates.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [2.6 patch] drivers/scsi/scsi_error.c should #include "scsi_transport_api.h"
2006-11-29 13:16 ` Matthew Wilcox
2006-11-29 14:13 ` James Smart
@ 2007-01-02 11:11 ` Christoph Hellwig
1 sibling, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2007-01-02 11:11 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: Adrian Bunk, James.Bottomley, linux-scsi, linux-kernel
On Wed, Nov 29, 2006 at 06:16:24AM -0700, Matthew Wilcox wrote:
> On Wed, Nov 29, 2006 at 11:04:22AM +0100, Adrian Bunk wrote:
> > +#include "scsi_transport_api.h"
>
> scsi_transport_api.h is a weird little file. It's not included by
> anything in the drivers/scsi directory, only
> drivers/scsi/libsas/sas_scsi_host.c:#include "../scsi_transport_api.h"
> drivers/ata/libata-eh.c:#include "../scsi/scsi_transport_api.h"
>
> To me, that says it should be living in include/scsi/ somewhere ...
> maybe just put the one function prototype into scsi_eh.h?
Yes, it should probably go into scsi_eh.h.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [2.6 patch] drivers/scsi/scsi_error.c should #include "scsi_transport_api.h"
@ 2007-07-29 15:01 Adrian Bunk
0 siblings, 0 replies; 6+ messages in thread
From: Adrian Bunk @ 2007-07-29 15:01 UTC (permalink / raw)
To: James.Bottomley; +Cc: linux-scsi, linux-kernel
Every file should #include the headers containing the prototypes for
its global functions (in this case for scsi_schedule_eh()).
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
--- linux-2.6.23-rc1-mm1/drivers/scsi/scsi_error.c.old 2007-07-28 17:10:48.000000000 +0200
+++ linux-2.6.23-rc1-mm1/drivers/scsi/scsi_error.c 2007-07-28 17:10:51.000000000 +0200
@@ -37,6 +37,7 @@
#include "scsi_priv.h"
#include "scsi_logging.h"
+#include "scsi_transport_api.h"
#define SENSE_TIMEOUT (10*HZ)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-07-29 15:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-29 15:01 [2.6 patch] drivers/scsi/scsi_error.c should #include "scsi_transport_api.h" Adrian Bunk
-- strict thread matches above, loose matches on Subject: below --
2006-11-29 10:04 Adrian Bunk
2006-11-29 13:16 ` Matthew Wilcox
2006-11-29 14:13 ` James Smart
2006-11-29 14:32 ` Matthew Wilcox
2007-01-02 11:11 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).