linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.6.1-rc1: SCSI: `TIMEOUT' redefined
       [not found] <Pine.LNX.4.58.0312310033110.30995@home.osdl.org>
@ 2004-01-06 18:33 ` Adrian Bunk
  2004-01-06 22:40   ` [PATCH] " Patrick Mansfield
  2004-01-06 22:40   ` Andrew Morton
  0 siblings, 2 replies; 3+ messages in thread
From: Adrian Bunk @ 2004-01-06 18:33 UTC (permalink / raw)
  To: patmans, neuffer, a.arnold
  Cc: Kernel Mailing List, James.Bottomley, linux-scsi

On Wed, Dec 31, 2003 at 12:36:49AM -0800, Linus Torvalds wrote:
>...
> Summary of changes from v2.6.0 to v2.6.1-rc1
> ============================================
>...
> Patrick Mansfield:
>   o consolidate and log scsi command on send and completion
>...

This adds a #define TIMEOUT to scsi.h conflicting with a different 
TIMEOUT #define in drivers/scsi/eata_generic.h:

<--  snip  -->

...
  CC      drivers/scsi/eata_pio.o
In file included from drivers/scsi/eata_pio.c:69:
drivers/scsi/eata_generic.h:84: warning: `TIMEOUT' redefined
include/scsi/scsi.h:305: warning: this is the location of the previous definition
...

<--  snip  -->

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] Re: 2.6.1-rc1: SCSI: `TIMEOUT' redefined
  2004-01-06 18:33 ` 2.6.1-rc1: SCSI: `TIMEOUT' redefined Adrian Bunk
@ 2004-01-06 22:40   ` Patrick Mansfield
  2004-01-06 22:40   ` Andrew Morton
  1 sibling, 0 replies; 3+ messages in thread
From: Patrick Mansfield @ 2004-01-06 22:40 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: neuffer, a.arnold, Kernel Mailing List, James.Bottomley,
	linux-scsi

On Tue, Jan 06, 2004 at 07:33:25PM +0100, Adrian Bunk wrote:
> On Wed, Dec 31, 2003 at 12:36:49AM -0800, Linus Torvalds wrote:
> >...
> > Summary of changes from v2.6.0 to v2.6.1-rc1
> > ============================================
> >...
> > Patrick Mansfield:
> >   o consolidate and log scsi command on send and completion
> >...
> 
> This adds a #define TIMEOUT to scsi.h conflicting with a different 
> TIMEOUT #define in drivers/scsi/eata_generic.h:

Sorry Adrian, here is a patch renaming TIMEOUT to TIMEOUT_ERROR.  Still
not a good name for the usage in SCSI core, but it does not conflict, and
matches the other names for the IO completion results (SUCCESS, FAILED,
etc., they and others should really be prefixed with at least SCSI).

eata does not use the TIMEOUT it defines, but there are enough defines of
TIMEOUT that it could be a problem in other drivers.

Only compile tested for eata driver.

--- 1.132/drivers/scsi/scsi.c	Tue Sep 30 07:24:17 2003
+++ edited/drivers/scsi/scsi.c	Tue Jan  6 13:13:34 2004
@@ -441,7 +441,7 @@
 			case FAILED:
 				printk("FAILED ");
 				break;
-			case TIMEOUT:
+			case TIMEOUT_ERROR:
 				/* 
 				 * If called via scsi_times_out.
 				 */
===== drivers/scsi/scsi_error.c 1.67 vs edited =====
--- 1.67/drivers/scsi/scsi_error.c	Mon Sep 29 05:37:28 2003
+++ edited/drivers/scsi/scsi_error.c	Tue Jan  6 13:12:58 2004
@@ -164,7 +164,7 @@
  **/
 void scsi_times_out(struct scsi_cmnd *scmd)
 {
-	scsi_log_completion(scmd, TIMEOUT);
+	scsi_log_completion(scmd, TIMEOUT_ERROR);
 	if (unlikely(!scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD))) {
 		panic("Error handler thread not present at %p %p %s %d",
 		      scmd, scmd->device->host, __FILE__, __LINE__);
===== include/scsi/scsi.h 1.15 vs edited =====
--- 1.15/include/scsi/scsi.h	Mon Sep 29 05:39:10 2003
+++ edited/include/scsi/scsi.h	Tue Jan  6 13:12:42 2004
@@ -302,7 +302,7 @@
 #define QUEUED          0x2004
 #define SOFT_ERROR      0x2005
 #define ADD_TO_MLQUEUE  0x2006
-#define TIMEOUT         0x2007
+#define TIMEOUT_ERROR   0x2007
 
 /*
  * Midlevel queue return values.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 2.6.1-rc1: SCSI: `TIMEOUT' redefined
  2004-01-06 18:33 ` 2.6.1-rc1: SCSI: `TIMEOUT' redefined Adrian Bunk
  2004-01-06 22:40   ` [PATCH] " Patrick Mansfield
@ 2004-01-06 22:40   ` Andrew Morton
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2004-01-06 22:40 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: patmans, neuffer, a.arnold, linux-kernel, James.Bottomley,
	linux-scsi

Adrian Bunk <bunk@fs.tum.de> wrote:
>
> On Wed, Dec 31, 2003 at 12:36:49AM -0800, Linus Torvalds wrote:
> >...
> > Summary of changes from v2.6.0 to v2.6.1-rc1
> > ============================================
> >...
> > Patrick Mansfield:
> >   o consolidate and log scsi command on send and completion
> >...
> 
> This adds a #define TIMEOUT to scsi.h conflicting with a different 
> TIMEOUT #define in drivers/scsi/eata_generic.h:

eww, bad idea.  I count more than twenty #defines of TIMEOUT in the kernel
tree.

We should change scsi.h - "TIMEOUT" is waaay too collision-prone.

In fact, a lot of those identifiers are quite poorly chosen:

#define NEEDS_RETRY     0x2001
#define SUCCESS         0x2002
#define FAILED          0x2003
#define QUEUED          0x2004
#define SOFT_ERROR      0x2005
#define ADD_TO_MLQUEUE  0x2006
#define TIMEOUT         0x2007

That's just asking for it.

This untested patch purports to fix just the TIMEOUT thing:

(hmm, SD_TIMEOUT is already taken, too).


diff -puN drivers/scsi/scsi.c~scsi-rename-TIMEOUT drivers/scsi/scsi.c
--- 25/drivers/scsi/scsi.c~scsi-rename-TIMEOUT	Tue Jan  6 14:37:24 2004
+++ 25-akpm/drivers/scsi/scsi.c	Tue Jan  6 14:37:35 2004
@@ -441,7 +441,7 @@ void scsi_log_completion(struct scsi_cmn
 			case FAILED:
 				printk("FAILED ");
 				break;
-			case TIMEOUT:
+			case SD_CMD_TIMEOUT:
 				/* 
 				 * If called via scsi_times_out.
 				 */
diff -puN drivers/scsi/scsi_error.c~scsi-rename-TIMEOUT drivers/scsi/scsi_error.c
--- 25/drivers/scsi/scsi_error.c~scsi-rename-TIMEOUT	Tue Jan  6 14:37:24 2004
+++ 25-akpm/drivers/scsi/scsi_error.c	Tue Jan  6 14:37:45 2004
@@ -164,7 +164,7 @@ int scsi_delete_timer(struct scsi_cmnd *
  **/
 void scsi_times_out(struct scsi_cmnd *scmd)
 {
-	scsi_log_completion(scmd, TIMEOUT);
+	scsi_log_completion(scmd, SD_CMD_TIMEOUT);
 	if (unlikely(!scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD))) {
 		panic("Error handler thread not present at %p %p %s %d",
 		      scmd, scmd->device->host, __FILE__, __LINE__);
diff -puN include/scsi/scsi.h~scsi-rename-TIMEOUT include/scsi/scsi.h
--- 25/include/scsi/scsi.h~scsi-rename-TIMEOUT	Tue Jan  6 14:37:24 2004
+++ 25-akpm/include/scsi/scsi.h	Tue Jan  6 14:37:54 2004
@@ -302,7 +302,7 @@ struct scsi_lun {
 #define QUEUED          0x2004
 #define SOFT_ERROR      0x2005
 #define ADD_TO_MLQUEUE  0x2006
-#define TIMEOUT         0x2007
+#define SD_CMD_TIMEOUT  0x2007
 
 /*
  * Midlevel queue return values.

_

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-01-06 22:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <Pine.LNX.4.58.0312310033110.30995@home.osdl.org>
2004-01-06 18:33 ` 2.6.1-rc1: SCSI: `TIMEOUT' redefined Adrian Bunk
2004-01-06 22:40   ` [PATCH] " Patrick Mansfield
2004-01-06 22:40   ` Andrew Morton

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).