qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Manos Pitsidianakis <el13635@mail.ntua.gr>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: qemu-devel@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] block: change variable names in BlockDriverState
Date: Fri, 9 Jun 2017 13:10:40 +0300	[thread overview]
Message-ID: <20170609101040.lxrnoxo7grbpxsct@postretch> (raw)
In-Reply-To: <20170609094113.GD26144@stefanha-x1.localdomain>

[-- Attachment #1: Type: text/plain, Size: 1566 bytes --]

On Fri, Jun 09, 2017 at 10:41:13AM +0100, Stefan Hajnoczi wrote:
>On Fri, Jun 09, 2017 at 02:22:55AM +0300, Manos Pitsidianakis wrote:
>> diff --git a/hw/ide/core.c b/hw/ide/core.c
>> index 0b48b64..1a74339 100644
>> --- a/hw/ide/core.c
>> +++ b/hw/ide/core.c
>> @@ -416,16 +416,16 @@ static void ide_issue_trim_cb(void *opaque, int ret)
>>                  /* 6-byte LBA + 2-byte range per entry */
>>                  uint64_t entry = le64_to_cpu(buffer[i]);
>>                  uint64_t sector = entry & 0x0000ffffffffffffULL;
>> -                uint16_t count = entry >> 48;
>> +                uint16_t bytes = entry >> 48;
>>
>> -                if (count == 0) {
>> +                if (bytes == 0) {
>>                      continue;
>>                  }
>>
>>                  /* Got an entry! Submit and exit.  */
>>                  iocb->aiocb = blk_aio_pdiscard(iocb->blk,
>>                                                 sector << BDRV_SECTOR_BITS,
>> -                                               count << BDRV_SECTOR_BITS,
>> +                                               bytes << BDRV_SECTOR_BITS,
>>                                                 ide_issue_trim_cb, opaque);
>>                  return;
>>              }
>
>This change looks suspicious:
>
>  bytes << BDRV_SECTOR_BITS
>
>Therefore 'bytes' is actually in units of sectors!
>
>Please drop this hunk.


:) Rookie mistake, thanks. (At some other places there's count >> 
BDRV_SECTOR_BITS, hope this change makes it clear) Will send a v3.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2017-06-09 10:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-08 23:22 [Qemu-devel] [PATCH v2] block: change variable names in BlockDriverState Manos Pitsidianakis
2017-06-09  9:41 ` Stefan Hajnoczi
2017-06-09 10:10   ` Manos Pitsidianakis [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=20170609101040.lxrnoxo7grbpxsct@postretch \
    --to=el13635@mail.ntua.gr \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.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 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).