Patchwork [v2,1/3] aio: switch aiocb_size type int -> size_t

login
register
mail settings
Submitter Stefan Hajnoczi
Date Oct. 31, 2012, 3:34 p.m.
Message ID <1351697677-31598-2-git-send-email-stefanha@redhat.com>
Download mbox | patch
Permalink /patch/195987/
State New
Headers show

Comments

Stefan Hajnoczi - Oct. 31, 2012, 3:34 p.m.
Using appropriate types for variables is a good thing :).  All users
simply do sizeof(MyType) and the value is passed to a memory allocator,
it should be size_t.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 qemu-aio.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Paolo Bonzini - Nov. 2, 2012, 2:49 p.m.
Il 31/10/2012 16:34, Stefan Hajnoczi ha scritto:
> Using appropriate types for variables is a good thing :).  All users
> simply do sizeof(MyType) and the value is passed to a memory allocator,
> it should be size_t.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  qemu-aio.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/qemu-aio.h b/qemu-aio.h
> index 1b7eb6e..111b0b3 100644
> --- a/qemu-aio.h
> +++ b/qemu-aio.h
> @@ -23,7 +23,7 @@ typedef void BlockDriverCompletionFunc(void *opaque, int ret);
>  
>  typedef struct AIOPool {
>      void (*cancel)(BlockDriverAIOCB *acb);
> -    int aiocb_size;
> +    size_t aiocb_size;
>      BlockDriverAIOCB *free_aiocb;
>  } AIOPool;
>  
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Patch

diff --git a/qemu-aio.h b/qemu-aio.h
index 1b7eb6e..111b0b3 100644
--- a/qemu-aio.h
+++ b/qemu-aio.h
@@ -23,7 +23,7 @@  typedef void BlockDriverCompletionFunc(void *opaque, int ret);
 
 typedef struct AIOPool {
     void (*cancel)(BlockDriverAIOCB *acb);
-    int aiocb_size;
+    size_t aiocb_size;
     BlockDriverAIOCB *free_aiocb;
 } AIOPool;