qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 05/14] Remove unused argument for check_for_bloc


From: Anthony Liguori
Subject: [Qemu-devel] Re: [PATCH 05/14] Remove unused argument for check_for_block_signature()
Date: Mon, 30 Aug 2010 11:16:46 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100713 Lightning/1.0b1 Thunderbird/3.0.6

On 08/30/2010 10:59 AM, address@hidden wrote:
From: Jes Sorensen<address@hidden>

Signed-off-by: Jes Sorensen<address@hidden>
---
  block/raw.c |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/raw.c b/block/raw.c
index 61e6748..fc057d0 100644
--- a/block/raw.c
+++ b/block/raw.c
@@ -12,7 +12,7 @@ static int raw_open(BlockDriverState *bs, int flags)
  /* check for the user attempting to write something that looks like a
     block format header to the beginning of the image and fail out.
  */
-static int check_for_block_signature(BlockDriverState *bs, const uint8_t *buf)
+static int check_for_block_signature(const uint8_t *buf)

This is why this type of warning sucks. Passing BlockDriverState is a matter of readability because these are roughly methods. Just because 'this' isn't used right now, doesn't mean that it should not be a method.

Regards,

Anthony Liguori

  {
      static const uint8_t signatures[][4] = {
          { 'Q', 'F', 'I', 0xfb }, /* qcow/qcow2 */
@@ -42,7 +42,7 @@ static int check_write_unsafe(BlockDriverState *bs, int64_t 
sector_num,
      }

      if (sector_num == 0&&  nb_sectors>  0) {
-        return check_for_block_signature(bs, buf);
+        return check_for_block_signature(buf);
      }

      return 0;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]