diff mbox

ata:ahci.c Fix warning: comparison between 'enum <anonymous>' and 'enum <anonymous>'

Message ID 1277866406-8253-1-git-send-email-justinmattock@gmail.com
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Justin Mattock June 30, 2010, 2:53 a.m. UTC
I'm seeing this while compiling. Not sure if it's from
gcc 4.6.0 or not:
  CC      drivers/ata/ahci.o
drivers/ata/ahci.c: In function 'ahci_init_one':
drivers/ata/ahci.c:1045:2: warning: comparison between 'enum <anonymous>' and 'enum <anonymous>'

I also noticed there's a patch out there that addresses the this issue:
http://kerneltrap.org/mailarchive/linux-kernel/2010/3/18/4549546
but theres not much after the thread to tell what happened.
In any case I'll let you guys decide on what fixes this issue
in the best way.

 Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>

---
 drivers/ata/ahci.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

=?UTF-8?Q?H=C3=A5kon_L=C3=B8vdal?= June 30, 2010, 6:11 a.m. UTC | #1
On 30 June 2010 04:53, Justin P. Mattock <justinmattock@gmail.com> wrote:
> -       int n_ports, i, rc;
> +       int n_ports, i, rc, sum = 32;
>
>        VPRINTK("ENTER\n");
>
> -       WARN_ON(ATA_MAX_QUEUE > AHCI_MAX_CMDS);
> +       WARN_ON(ATA_MAX_QUEUE > sum);

Should'nt that rather be

       int n_ports, i, rc, sum = AHCI_MAX_CMDS;

?

BR Håkon Løvdal
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Justin Mattock June 30, 2010, 6:25 a.m. UTC | #2
On 06/29/2010 11:11 PM, Håkon Løvdal wrote:
> On 30 June 2010 04:53, Justin P. Mattock<justinmattock@gmail.com>  wrote:
>> -       int n_ports, i, rc;
>> +       int n_ports, i, rc, sum = 32;
>>
>>         VPRINTK("ENTER\n");
>>
>> -       WARN_ON(ATA_MAX_QUEUE>  AHCI_MAX_CMDS);
>> +       WARN_ON(ATA_MAX_QUEUE>  sum);
>
> Should'nt that rather be
>
>         int n_ports, i, rc, sum = AHCI_MAX_CMDS;
>
> ?
>
> BR Håkon Løvdal
>

I didnt even think todo that. I just rebuilt with that change, and all 
is good from the compiling stand point. should I resend?

Thanks for the help.

Justin P. Mattock
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Justin Mattock June 30, 2010, 6:38 a.m. UTC | #3
On 06/29/2010 11:11 PM, Håkon Løvdal wrote:
> On 30 June 2010 04:53, Justin P. Mattock<justinmattock@gmail.com>  wrote:
>> -       int n_ports, i, rc;
>> +       int n_ports, i, rc, sum = 32;
>>
>>         VPRINTK("ENTER\n");
>>
>> -       WARN_ON(ATA_MAX_QUEUE>  AHCI_MAX_CMDS);
>> +       WARN_ON(ATA_MAX_QUEUE>  sum);
>
> Should'nt that rather be
>
>         int n_ports, i, rc, sum = AHCI_MAX_CMDS;
>
> ?
>
> BR Håkon Løvdal
>

o.k. I resent again with the small change that you had mentioned.

Justin P. Mattock
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 8ca16f5..5282e93 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1038,11 +1038,11 @@  static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	struct device *dev = &pdev->dev;
 	struct ahci_host_priv *hpriv;
 	struct ata_host *host;
-	int n_ports, i, rc;
+	int n_ports, i, rc, sum = 32;
 
 	VPRINTK("ENTER\n");
 
-	WARN_ON(ATA_MAX_QUEUE > AHCI_MAX_CMDS);
+	WARN_ON(ATA_MAX_QUEUE > sum);
 
 	if (!printed_version++)
 		dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");