linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]ata:ahci.c Fix warning: comparison between 'enum <anonymous>' and 'enum <anonymous>'
@ 2010-06-30  2:53 Justin P. Mattock
  2010-06-30  6:11 ` Håkon Løvdal
  0 siblings, 1 reply; 8+ messages in thread
From: Justin P. Mattock @ 2010-06-30  2:53 UTC (permalink / raw)
  To: linux-ide; +Cc: jgarzik, tj, Justin P. Mattock

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

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");
-- 
1.7.1.rc1.21.gf3bd6


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

* Re: [PATCH]ata:ahci.c Fix warning: comparison between 'enum <anonymous>' and 'enum <anonymous>'
  2010-06-30  2:53 Justin P. Mattock
@ 2010-06-30  6:11 ` Håkon Løvdal
  2010-06-30  6:25   ` Justin P. Mattock
  2010-06-30  6:38   ` Justin P. Mattock
  0 siblings, 2 replies; 8+ messages in thread
From: Håkon Løvdal @ 2010-06-30  6:11 UTC (permalink / raw)
  To: Justin P. Mattock; +Cc: linux-ide, jgarzik, tj

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

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

* Re: [PATCH]ata:ahci.c Fix warning: comparison between 'enum  <anonymous>' and 'enum <anonymous>'
  2010-06-30  6:11 ` Håkon Løvdal
@ 2010-06-30  6:25   ` Justin P. Mattock
  2010-06-30  6:38   ` Justin P. Mattock
  1 sibling, 0 replies; 8+ messages in thread
From: Justin P. Mattock @ 2010-06-30  6:25 UTC (permalink / raw)
  To: Håkon Løvdal; +Cc: linux-ide, jgarzik, tj

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

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

* Re: [PATCH]ata:ahci.c Fix warning: comparison between 'enum  <anonymous>' and 'enum <anonymous>'
  2010-06-30  6:11 ` Håkon Løvdal
  2010-06-30  6:25   ` Justin P. Mattock
@ 2010-06-30  6:38   ` Justin P. Mattock
  1 sibling, 0 replies; 8+ messages in thread
From: Justin P. Mattock @ 2010-06-30  6:38 UTC (permalink / raw)
  To: Håkon Løvdal; +Cc: linux-ide, jgarzik, tj

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

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

* [PATCH]ata:ahci.c Fix warning: comparison between 'enum <anonymous>' and 'enum <anonymous>'
@ 2010-07-03 14:29 Justin P. Mattock
  2010-07-03 14:30 ` Tejun Heo
  2010-07-14  7:51 ` Jeff Garzik
  0 siblings, 2 replies; 8+ messages in thread
From: Justin P. Mattock @ 2010-07-03 14:29 UTC (permalink / raw)
  To: linux-ide; +Cc: tj, jgarzik, Justin P. Mattock

The below patch casts ATA_MAX_QUEUE to int because GCC will 
give a warning message about the two different enum blocks:
  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>'
 
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>

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

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index f252253..fe75d8b 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1042,7 +1042,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	VPRINTK("ENTER\n");
 
-	WARN_ON(ATA_MAX_QUEUE > AHCI_MAX_CMDS);
+	WARN_ON((int)ATA_MAX_QUEUE > AHCI_MAX_CMDS);
 
 	if (!printed_version++)
 		dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
-- 
1.7.1.rc1.21.gf3bd6


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

* Re: [PATCH]ata:ahci.c Fix warning: comparison between 'enum <anonymous>' and 'enum <anonymous>'
  2010-07-03 14:29 [PATCH]ata:ahci.c Fix warning: comparison between 'enum <anonymous>' and 'enum <anonymous>' Justin P. Mattock
@ 2010-07-03 14:30 ` Tejun Heo
  2010-07-14  7:51 ` Jeff Garzik
  1 sibling, 0 replies; 8+ messages in thread
From: Tejun Heo @ 2010-07-03 14:30 UTC (permalink / raw)
  To: Justin P. Mattock; +Cc: linux-ide, jgarzik

On 07/03/2010 04:29 PM, Justin P. Mattock wrote:
> The below patch casts ATA_MAX_QUEUE to int because GCC will 
> give a warning message about the two different enum blocks:
>   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>'
>  
> Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun

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

* Re: [PATCH]ata:ahci.c Fix warning: comparison between 'enum <anonymous>' and 'enum <anonymous>'
  2010-07-03 14:29 [PATCH]ata:ahci.c Fix warning: comparison between 'enum <anonymous>' and 'enum <anonymous>' Justin P. Mattock
  2010-07-03 14:30 ` Tejun Heo
@ 2010-07-14  7:51 ` Jeff Garzik
  2010-07-14 13:35   ` Justin P. Mattock
  1 sibling, 1 reply; 8+ messages in thread
From: Jeff Garzik @ 2010-07-14  7:51 UTC (permalink / raw)
  To: Justin P. Mattock; +Cc: linux-ide, tj

On 07/03/2010 10:29 AM, Justin P. Mattock wrote:
> The below patch casts ATA_MAX_QUEUE to int because GCC will
> give a warning message about the two different enum blocks:
>    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>'
>
> Signed-off-by: Justin P. Mattock<justinmattock@gmail.com>
>
> ---
>   drivers/ata/ahci.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
> index f252253..fe75d8b 100644
> --- a/drivers/ata/ahci.c
> +++ b/drivers/ata/ahci.c
> @@ -1042,7 +1042,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>
>   	VPRINTK("ENTER\n");
>
> -	WARN_ON(ATA_MAX_QUEUE>  AHCI_MAX_CMDS);
> +	WARN_ON((int)ATA_MAX_QUEUE>  AHCI_MAX_CMDS);
>

applied



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

* Re: [PATCH]ata:ahci.c Fix warning: comparison between 'enum <anonymous>' and 'enum <anonymous>'
  2010-07-14  7:51 ` Jeff Garzik
@ 2010-07-14 13:35   ` Justin P. Mattock
  0 siblings, 0 replies; 8+ messages in thread
From: Justin P. Mattock @ 2010-07-14 13:35 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-ide, tj

On 07/14/2010 12:51 AM, Jeff Garzik wrote:
> On 07/03/2010 10:29 AM, Justin P. Mattock wrote:
>> The below patch casts ATA_MAX_QUEUE to int because GCC will
>> give a warning message about the two different enum blocks:
>> 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>'
>>
>> Signed-off-by: Justin P. Mattock<justinmattock@gmail.com>
>>
>> ---
>> drivers/ata/ahci.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
>> index f252253..fe75d8b 100644
>> --- a/drivers/ata/ahci.c
>> +++ b/drivers/ata/ahci.c
>> @@ -1042,7 +1042,7 @@ static int ahci_init_one(struct pci_dev *pdev,
>> const struct pci_device_id *ent)
>>
>> VPRINTK("ENTER\n");
>>
>> - WARN_ON(ATA_MAX_QUEUE> AHCI_MAX_CMDS);
>> + WARN_ON((int)ATA_MAX_QUEUE> AHCI_MAX_CMDS);
>>
>
> applied
>
>
>

o.k. cool..

Justin P. Mattock

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

end of thread, other threads:[~2010-07-14 13:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-03 14:29 [PATCH]ata:ahci.c Fix warning: comparison between 'enum <anonymous>' and 'enum <anonymous>' Justin P. Mattock
2010-07-03 14:30 ` Tejun Heo
2010-07-14  7:51 ` Jeff Garzik
2010-07-14 13:35   ` Justin P. Mattock
  -- strict thread matches above, loose matches on Subject: below --
2010-06-30  2:53 Justin P. Mattock
2010-06-30  6:11 ` Håkon Løvdal
2010-06-30  6:25   ` Justin P. Mattock
2010-06-30  6:38   ` Justin P. Mattock

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