summaryrefslogtreecommitdiffstats
path: root/sound/oss/soundcard.c
diff options
context:
space:
mode:
authorAhmed S. Darwish <darwish.07@gmail.com>2007-02-12 00:52:07 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 09:48:28 -0800
commitb322f4095056d6849c49412eb3e36637a062e9c0 (patch)
treee9923a60b1a38cd6d1609d21fe74d7dada28e09f /sound/oss/soundcard.c
parent9d0094de6dfda8209241787d99f531356469d0f5 (diff)
downloadop-kernel-dev-b322f4095056d6849c49412eb3e36637a062e9c0.zip
op-kernel-dev-b322f4095056d6849c49412eb3e36637a062e9c0.tar.gz
[PATCH] OSS: Use ARRAY_SIZE macro when appropriate
Use ARRAY_SIZE macro already defined in kernel.h Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'sound/oss/soundcard.c')
-rw-r--r--sound/oss/soundcard.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c
index a89108c..b92c8cd 100644
--- a/sound/oss/soundcard.c
+++ b/sound/oss/soundcard.c
@@ -32,6 +32,7 @@
#include <linux/ctype.h>
#include <linux/stddef.h>
#include <linux/kmod.h>
+#include <linux/kernel.h>
#include <asm/dma.h>
#include <asm/io.h>
#include <linux/wait.h>
@@ -557,7 +558,7 @@ static int __init oss_init(void)
/* Protecting the innocent */
sound_dmap_flag = (dmabuf > 0 ? 1 : 0);
- for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) {
+ for (i = 0; i < ARRAY_SIZE(dev_list); i++) {
device_create(sound_class, NULL,
MKDEV(SOUND_MAJOR, dev_list[i].minor),
"%s", dev_list[i].name);
@@ -581,7 +582,7 @@ static void __exit oss_cleanup(void)
{
int i, j;
- for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) {
+ for (i = 0; i < ARRAY_SIZE(dev_list); i++) {
device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor));
if (!dev_list[i].num)
continue;
OpenPOWER on IntegriCloud