On 09/10/10 19:05, Blue Swirl wrote:
> On Fri, Sep 10, 2010 at 2:04 PM,  <jes.soren...@redhat.com> wrote:
>> From: Jes Sorensen <jes.soren...@redhat.com>
>>
>> Signed-off-by: Jes Sorensen <jes.soren...@redhat.com>
>> ---
>>  block/blkdebug.c |    7 ++++++-
>>  1 files changed, 6 insertions(+), 1 deletions(-)
>>
>> diff --git a/block/blkdebug.c b/block/blkdebug.c
>> index 2a63df9..17d796d 100644
>> --- a/block/blkdebug.c
>> +++ b/block/blkdebug.c
>> @@ -439,7 +439,12 @@ static void blkdebug_debug_event(BlockDriverState *bs, 
>> BlkDebugEvent event)
>>     struct BlkdebugRule *rule;
>>     BlkdebugVars old_vars = s->vars;
>>
>> -    if (event < 0 || event >= BLKDBG_EVENT_MAX) {
>> +    /*
>> +     * enum is not guaranteed to be signed on all archs, so cast to
>> +     * int before the comparison against zero to avoid compiler
>> +     * warning when building with -Wtype-limits
>> +     */
>> +    if ((int)event < 0 || event >= BLKDBG_EVENT_MAX) {
> 
> I changed 'if' to 'assert' in my version because the check could only
> fail due to an internal error:
> http://lists.nongnu.org/archive/html/qemu-devel/2010-09/msg00239.html

Sorry I missed your posting. I am happy with your version too, ACK from me.

I did a pull before doing this patch and didn't see it, which is why I
posted my version, but your patch does the trick nicely.

Cheers,
Jes

Reply via email to