linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: "Justin P. Mattock" <justinmattock@gmail.com>
Cc: linux-ide@vger.kernel.org, jgarzik@pobox.com
Subject: Re: [PATCH v2]ata:ahci.c Fix warning: comparison between 'enum <anonymous>' and 'enum <anonymous>'
Date: Sat, 03 Jul 2010 11:57:49 +0200	[thread overview]
Message-ID: <4C2F099D.1080806@kernel.org> (raw)
In-Reply-To: <4C2AF088.2080609@gmail.com>

Hello,

On 06/30/2010 09:21 AM, Justin P. Mattock wrote:
>> What does the extra warning buy us?  There are several places which
>> use anonymous enums for constants and I can't see what the benefit of
>> this warning would be.
>
> I don't think it buys us anything..think it's just saying "hey
> you have two #defines with the same value" or something in that
> area(if Im reading the warning correctly) funny thing is, is
> gcc should of done the same with the original patch that I
> sent, as well as the second..  (but could be wrong).

Okay, just tested and it's warning that the code is comparing two
enums which are from two different enum blocks.  I'm kind of
doubtful about its usefulness but then again I don't think there
will be many occassions of this to be problematic either.  For
now, can you please submit a patch to cast just ATA_MAX_QUEUE
to (int) before comparing and short comment explanining why it's
necessary?

Thanks.

-- 
tejun


  reply	other threads:[~2010-07-03  9:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-30  6:37 [PATCH v2]ata:ahci.c Fix warning: comparison between 'enum <anonymous>' and 'enum <anonymous>' Justin P. Mattock
2010-06-30  6:49 ` Tejun Heo
2010-06-30  7:06   ` Justin P. Mattock
2010-06-30  7:11     ` Tejun Heo
2010-06-30  7:21       ` Justin P. Mattock
2010-07-03  9:57         ` Tejun Heo [this message]
2010-07-03 14:32           ` Justin P. Mattock
2010-07-03 14:39           ` Justin P. Mattock

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C2F099D.1080806@kernel.org \
    --to=tj@kernel.org \
    --cc=jgarzik@pobox.com \
    --cc=justinmattock@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).