Patchwork Remove un-needed code

login
register
mail settings
Submitter Bruce Rogers
Date April 9, 2010, 10:55 p.m.
Message ID <4BBF5BE50200004800092A6A@sinclair.provo.novell.com>
Download mbox | patch
Permalink /patch/49872/
State New
Headers show

Comments

Bruce Rogers - April 9, 2010, 10:55 p.m.
The set_geometry_hint call below is not needed - it's just setting what was just read.

Signed-Off-By: Bruce Rogers <brogers@novell.com
Kevin Wolf - April 12, 2010, 8:53 a.m.
Am 10.04.2010 00:55, schrieb Bruce Rogers:
> The set_geometry_hint call below is not needed - it's just setting what was just read.
> 
> Signed-Off-By: Bruce Rogers <brogers@novell.com

It needs to be "Signed-off-by" with lower-case o and b to be recognized
by git, and the right angle bracket is missing.

> 
> diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
> index 9915840..bc4fa77 100644
> --- a/hw/virtio-blk.c
> +++ b/hw/virtio-blk.c
> @@ -494,7 +494,6 @@ VirtIODevice *virtio_blk_init(DeviceState *dev, BlockConf *c
> onf)

Patch is incorrectly wrapped here.

>      s->rq = NULL;
>      s->sector_mask = (s->conf->logical_block_size / 512) - 1;
>      bdrv_guess_geometry(s->bs, &cylinders, &heads, &secs);
> -    bdrv_set_geometry_hint(s->bs, cylinders, heads, secs);
>  
>      s->vq = virtio_add_queue(&s->vdev, 128, virtio_blk_handle_output);

bdrv_guess_geometry is not a simple getter function, but it already
calls bdrv_set_geometry_hint itself, so I think the logic is correct.

Kevin
Bruce Rogers - April 12, 2010, 1:02 p.m.
On 4/12/2010 at 2:53 AM, Kevin Wolf <kwolf@redhat.com> wrote:
> Am 10.04.2010 00:55, schrieb Bruce Rogers:
>> The set_geometry_hint call below is not needed - it's just setting what was 
> just read.
>> 
>> Signed-Off-By: Bruce Rogers <brogers@novell.com 
> 
> It needs to be "Signed-off-by" with lower-case o and b to be recognized
> by git, and the right angle bracket is missing.
> 
>> 
>> diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
>> index 9915840..bc4fa77 100644
>> --- a/hw/virtio-blk.c
>> +++ b/hw/virtio-blk.c
>> @@ -494,7 +494,6 @@ VirtIODevice *virtio_blk_init(DeviceState *dev, BlockConf 
> *c
>> onf)
> 
> Patch is incorrectly wrapped here.
> 
>>      s->rq = NULL;
>>      s->sector_mask = (s->conf->logical_block_size / 512) - 1;
>>      bdrv_guess_geometry(s->bs, &cylinders, &heads, &secs);
>> -    bdrv_set_geometry_hint(s->bs, cylinders, heads, secs);
>>  
>>      s->vq = virtio_add_queue(&s->vdev, 128, virtio_blk_handle_output);
> 
> bdrv_guess_geometry is not a simple getter function, but it already
> calls bdrv_set_geometry_hint itself, so I think the logic is correct.
> 
> Kevin

I've re-posted with these items fixed. Thanks.
Bruce

Patch

diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index 9915840..bc4fa77 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -494,7 +494,6 @@  VirtIODevice *virtio_blk_init(DeviceState *dev, BlockConf *c
onf)
     s->rq = NULL;
     s->sector_mask = (s->conf->logical_block_size / 512) - 1;
     bdrv_guess_geometry(s->bs, &cylinders, &heads, &secs);
-    bdrv_set_geometry_hint(s->bs, cylinders, heads, secs);
 
     s->vq = virtio_add_queue(&s->vdev, 128, virtio_blk_handle_output);