Commit 4f7bef7a authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Michael Ellerman

drivers: macintosh: rack-meter: fix bogus memsets

Fix bogus memsets pointed out by sparse:

linux-v4.3/drivers/macintosh/rack-meter.c:157:15: warning: memset with byte count of 0
linux-v4.3/drivers/macintosh/rack-meter.c:158:15: warning: memset with byte count of 0

Probably "&" is mistyped "*"; use ARRAY_SIZE to make it more safe.
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent c796d1d9
...@@ -154,8 +154,8 @@ static void rackmeter_do_pause(struct rackmeter *rm, int pause) ...@@ -154,8 +154,8 @@ static void rackmeter_do_pause(struct rackmeter *rm, int pause)
DBDMA_DO_STOP(rm->dma_regs); DBDMA_DO_STOP(rm->dma_regs);
return; return;
} }
memset(rdma->buf1, 0, SAMPLE_COUNT & sizeof(u32)); memset(rdma->buf1, 0, ARRAY_SIZE(rdma->buf1));
memset(rdma->buf2, 0, SAMPLE_COUNT & sizeof(u32)); memset(rdma->buf2, 0, ARRAY_SIZE(rdma->buf2));
rm->dma_buf_v->mark = 0; rm->dma_buf_v->mark = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment