diff options
author | Stefan Weil | 2013-12-07 14:48:04 +0100 |
---|---|---|
committer | Michael Tokarev | 2013-12-23 13:02:19 +0100 |
commit | dff7424dc09635c33b42193fbb40c90fc9a971f4 (patch) | |
tree | fda83ed12cf421bf72152cb7683fcf61e5fb2ae3 /hw/audio | |
parent | openrisc: Fix spelling in comment (transaltion -> translation) (diff) | |
download | qemu-dff7424dc09635c33b42193fbb40c90fc9a971f4.tar.gz qemu-dff7424dc09635c33b42193fbb40c90fc9a971f4.tar.xz qemu-dff7424dc09635c33b42193fbb40c90fc9a971f4.zip |
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')
-rw-r--r-- | hw/audio/intel-hda.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index 6ab8c245d3..d41f82cec4 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; } |