All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gonglei <arei.gonglei@huawei.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3] virtio-blk: trivial code optimization
Date: Wed, 11 Nov 2015 09:53:59 +0800	[thread overview]
Message-ID: <56429FB7.3090105@huawei.com> (raw)
In-Reply-To: <20151110095616.GB14128@stefanha-x1.localdomain>

On 2015/11/10 17:56, Stefan Hajnoczi wrote:

> The C99 standard says:
> 
> 6.3.1.1 Boolean, characters, and integers
> 
> - The rank of a signed integer type shall be greater than the rank of
> any signed integer type with less precision.
> 
> ...
> 
> - The rank of any unsigned integer type shall equal the rank of the
> corresponding signed integer type, if any.
> 
> 6.3.1.8 Usual arithmetic conversions
> 
> Otherwise, if the operand that has unsigned integer type has rank
> greater or equal to the rank of the type of the other operand, then the
> operand with signed integer type is converted to the type of the operand
> with unsigned integer type.
> 
> So the max_xfer_len int operand must be converted to the higher ranking
> unsigned long long.
> 

Thank you so much, it's clear. I'll add a check before subtraction.
Please review v4.

Regards,
-Gonglei

      reply	other threads:[~2015-11-11  1:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-09  9:03 [Qemu-devel] [PATCH v3] virtio-blk: trivial code optimization arei.gonglei
2015-11-09 13:28 ` Paolo Bonzini
2015-11-09 13:57 ` Stefan Hajnoczi
2015-11-10  6:35   ` Gonglei
2015-11-10  9:51     ` Paolo Bonzini
2015-11-10  9:56     ` Stefan Hajnoczi
2015-11-11  1:53       ` Gonglei [this message]

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=56429FB7.3090105@huawei.com \
    --to=arei.gonglei@huawei.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.