wm8750: Fix calculation of number of array elements
authorStefan Weil <sw@weilnetz.de>
Mon, 9 Jan 2012 18:32:04 +0000 (19:32 +0100)
committerAndrzej Zaborowski <andrew.zaborowski@intel.com>
Tue, 10 Jan 2012 17:47:06 +0000 (18:47 +0100)
Coverity says that the division by sizeof(*s->rate) might be wrong.
I think that coverity is right.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
hw/wm8750.c

index 39383f43e564e2f79fd9317b331cf60a4478404e..9fbdf3d54b9c2ac08cb6763be77149364c7f1759 100644 (file)
@@ -563,7 +563,7 @@ static void wm8750_pre_save(void *opaque)
 {
     WM8750State *s = opaque;
 
-    s->rate_vmstate = (s->rate - wm_rate_table) / sizeof(*s->rate);
+    s->rate_vmstate = s->rate - wm_rate_table;
 }
 
 static int wm8750_post_load(void *opaque, int version_id)