wm8750: Fix calculation of number of array elements

Submitted by Stefan Weil on Jan. 9, 2012, 6:32 p.m.

Details

Message ID 1326133924-1621-1-git-send-email-sw@weilnetz.de
State Accepted
Headers show

Commit Message

Stefan Weil Jan. 9, 2012, 6:32 p.m.
Coverity says that the division by sizeof(*s->rate) might be wrong.
I think that coverity is right.

Cc: Andrzej Zaborowski <balrogg@gmail.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 hw/wm8750.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

andrzej zaborowski Jan. 10, 2012, 5:46 p.m.
On 9 January 2012 19:32, Stefan Weil <sw@weilnetz.de> wrote:
> Coverity says that the division by sizeof(*s->rate) might be wrong.
> I think that coverity is right.

Thanks, applied.

Cheers

Patch hide | download patch | download mbox

diff --git a/hw/wm8750.c b/hw/wm8750.c
index 39383f4..b3589d3 100644
--- a/hw/wm8750.c
+++ b/hw/wm8750.c
@@ -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)