Re: [PATCH libata-2.6] AHCI: compiler warning fix

2005-03-22 Thread Jeff Garzik
Brett Russ wrote:
This fixes the compile warning below, which seems due to the enum
being signed:
drivers/scsi/ahci.c:199: warning: overflow in implicit constant
conversion
Signed-off-by: Brett Russ [EMAIL PROTECTED]
= drivers/scsi/ahci.c 1.17 vs edited =
--- 1.17/drivers/scsi/ahci.c	Thu Feb 24 14:52:41 2005
+++ edited/drivers/scsi/ahci.c	Wed Mar  9 17:29:36 2005
@@ -44,7 +44,6 @@
 enum {
 	AHCI_PCI_BAR		= 5,
 	AHCI_MAX_SG		= 168, /* hardware max is 64K */
-	AHCI_DMA_BOUNDARY	= 0x,
 	AHCI_USE_CLUSTERING	= 0,
 	AHCI_CMD_SLOT_SZ	= 32 * 32,
 	AHCI_RX_FIS_SZ		= 256,
@@ -135,6 +134,8 @@
 	PORT_CMD_ICC_SLUMBER	= (0x6  28), /* Put i/f in slumber state */
 };
 
+#define AHCI_DMA_BOUNDARY	0x
+
I really don't like defines.  They aren't visible to debuggers and other 
post-cpp checking tools.

It should kill the warning if you move it into a separate enum, and add 
a UL suffix to the constant, I should think?

Jeff

-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH libata-2.6] AHCI: compiler warning fix

2005-03-11 Thread Jeff Garzik
Brett Russ wrote:
This fixes the compile warning below, which seems due to the enum
being signed:
drivers/scsi/ahci.c:199: warning: overflow in implicit constant
conversion
Signed-off-by: Brett Russ [EMAIL PROTECTED]
= drivers/scsi/ahci.c 1.17 vs edited =
--- 1.17/drivers/scsi/ahci.c	Thu Feb 24 14:52:41 2005
+++ edited/drivers/scsi/ahci.c	Wed Mar  9 17:29:36 2005
@@ -44,7 +44,6 @@
 enum {
 	AHCI_PCI_BAR		= 5,
 	AHCI_MAX_SG		= 168, /* hardware max is 64K */
-	AHCI_DMA_BOUNDARY	= 0x,
 	AHCI_USE_CLUSTERING	= 0,
 	AHCI_CMD_SLOT_SZ	= 32 * 32,
 	AHCI_RX_FIS_SZ		= 256,
@@ -135,6 +134,8 @@
 	PORT_CMD_ICC_SLUMBER	= (0x6  28), /* Put i/f in slumber state */
 };
 
+#define AHCI_DMA_BOUNDARY	0x
h, I think there's a better way to fix this.  A separate enum, and 
adding the suffix 'UL' to 0x should work, I would think.

In general, I try to avoid adding #defines of any nature.  It's just as 
efficient as an enum, and type/symbol information is available to the 
compiler and debugger when you use an enum.

Jeff

-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html