aboutsummaryrefslogtreecommitdiff
path: root/hw/audio/intel-hda.c
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2013-12-07 14:48:04 +0100
committerMichael Tokarev <mjt@tls.msk.ru>2013-12-23 16:02:19 +0400
commitdff7424dc09635c33b42193fbb40c90fc9a971f4 (patch)
treefda83ed12cf421bf72152cb7683fcf61e5fb2ae3 /hw/audio/intel-hda.c
parent2e0fc3a488ef12c4e0e3ad4e1a07efec3a19169e (diff)
downloadqemu-dff7424dc09635c33b42193fbb40c90fc9a971f4.zip
qemu-dff7424dc09635c33b42193fbb40c90fc9a971f4.tar.gz
qemu-dff7424dc09635c33b42193fbb40c90fc9a971f4.tar.bz2
misc: Use macro ARRAY_SIZE where possible
This improves readability and simplifies the code. Cc: Anthony Liguori <aliguori@amazon.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'hw/audio/intel-hda.c')
-rw-r--r--hw/audio/intel-hda.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c
index 6ab8c24..d41f82c 100644
--- a/hw/audio/intel-hda.c
+++ b/hw/audio/intel-hda.c
@@ -900,7 +900,7 @@ static const IntelHDAReg *intel_hda_reg_find(IntelHDAState *d, hwaddr addr)
{
const IntelHDAReg *reg;
- if (addr >= sizeof(regtab)/sizeof(regtab[0])) {
+ if (addr >= ARRAY_SIZE(regtab)) {
goto noreg;
}
reg = regtab+addr;
@@ -1025,7 +1025,7 @@ static void intel_hda_regs_reset(IntelHDAState *d)
uint32_t *addr;
int i;
- for (i = 0; i < sizeof(regtab)/sizeof(regtab[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE(regtab); i++) {
if (regtab[i].name == NULL) {
continue;
}