diff mbox

[v2] block/rbd: Remove unused local variable

Message ID 1307736330-13457-1-git-send-email-weil@mail.berlios.de
State Accepted
Headers show

Commit Message

Stefan Weil June 10, 2011, 8:05 p.m. UTC
Variable 'snap' is assigned a value that is never used.
Remove snap and the related code.

v2:
  The unused variable which was in function rbd_open is now in function
  qemu_rbd_create, so the patch needed an update.

Cc: Christian Brunner <chb@muc.de>
Cc: Josh Durgin <josh.durgin@dreamhost.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 block/rbd.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

Comments

Josh Durgin June 13, 2011, 6:06 p.m. UTC | #1
On 06/10/2011 01:05 PM, Stefan Weil wrote:
> Variable 'snap' is assigned a value that is never used.
> Remove snap and the related code.
>
> v2:
>    The unused variable which was in function rbd_open is now in function
>    qemu_rbd_create, so the patch needed an update.
>
> Cc: Christian Brunner<chb@muc.de>
> Cc: Josh Durgin<josh.durgin@dreamhost.com>
> Cc: Kevin Wolf<kwolf@redhat.com>
> Signed-off-by: Stefan Weil<weil@mail.berlios.de>
> ---
>   block/rbd.c |    4 ----
>   1 files changed, 0 insertions(+), 4 deletions(-)
>
> diff --git a/block/rbd.c b/block/rbd.c
> index bdc448a..d5659cd 100644
> --- a/block/rbd.c
> +++ b/block/rbd.c
> @@ -227,7 +227,6 @@ static int qemu_rbd_create(const char *filename, QEMUOptionParameter *options)
>       char name[RBD_MAX_IMAGE_NAME_SIZE];
>       char snap_buf[RBD_MAX_SNAP_NAME_SIZE];
>       char conf[RBD_MAX_CONF_SIZE];
> -    char *snap = NULL;
>       rados_t cluster;
>       rados_ioctx_t io_ctx;
>       int ret;
> @@ -238,9 +237,6 @@ static int qemu_rbd_create(const char *filename, QEMUOptionParameter *options)
>                              conf, sizeof(conf))<  0) {
>           return -EINVAL;
>       }
> -    if (snap_buf[0] != '\0') {
> -        snap = snap_buf;
> -    }
>
>       /* Read out options */
>       while (options&&  options->name) {

Looks good to me:

Reviewed-by: Josh Durgin <josh.durgin@dreamhost.com>
Kevin Wolf June 14, 2011, 8:01 a.m. UTC | #2
Am 10.06.2011 22:05, schrieb Stefan Weil:
> Variable 'snap' is assigned a value that is never used.
> Remove snap and the related code.
> 
> v2:
>   The unused variable which was in function rbd_open is now in function
>   qemu_rbd_create, so the patch needed an update.
> 
> Cc: Christian Brunner <chb@muc.de>
> Cc: Josh Durgin <josh.durgin@dreamhost.com>
> Cc: Kevin Wolf <kwolf@redhat.com>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>

Thanks, applied to the block branch.

Kevin
diff mbox

Patch

diff --git a/block/rbd.c b/block/rbd.c
index bdc448a..d5659cd 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -227,7 +227,6 @@  static int qemu_rbd_create(const char *filename, QEMUOptionParameter *options)
     char name[RBD_MAX_IMAGE_NAME_SIZE];
     char snap_buf[RBD_MAX_SNAP_NAME_SIZE];
     char conf[RBD_MAX_CONF_SIZE];
-    char *snap = NULL;
     rados_t cluster;
     rados_ioctx_t io_ctx;
     int ret;
@@ -238,9 +237,6 @@  static int qemu_rbd_create(const char *filename, QEMUOptionParameter *options)
                            conf, sizeof(conf)) < 0) {
         return -EINVAL;
     }
-    if (snap_buf[0] != '\0') {
-        snap = snap_buf;
-    }
 
     /* Read out options */
     while (options && options->name) {