[PATCH] OSS: Use ARRAY_SIZE macro when appropriate (2)
authorAhmed S. Darwish <darwish.07@gmail.com>
Mon, 12 Feb 2007 08:52:08 +0000 (00:52 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 12 Feb 2007 17:48:29 +0000 (09:48 -0800)
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>
sound/oss/au1550_ac97.c
sound/oss/nec_vrc5477.c
sound/oss/swarm_cs4297a.c

index 219795171c714796df5aaa51f740abd75fad7116..a339f0c0d5129323068a89831adb19fcbefa38cc 100644 (file)
@@ -1354,11 +1354,11 @@ au1550_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
                ((file->f_mode & FMODE_READ) && s->dma_adc.mapped);
 
 #ifdef DEBUG
                ((file->f_mode & FMODE_READ) && s->dma_adc.mapped);
 
 #ifdef DEBUG
-       for (count=0; count<sizeof(ioctl_str)/sizeof(ioctl_str[0]); count++) {
+       for (count = 0; count < ARRAY_SIZE(ioctl_str); count++) {
                if (ioctl_str[count].cmd == cmd)
                        break;
        }
                if (ioctl_str[count].cmd == cmd)
                        break;
        }
-       if (count < sizeof(ioctl_str) / sizeof(ioctl_str[0]))
+       if (count < ARRAY_SIZE(ioctl_str))
                pr_debug("ioctl %s, arg=0x%lxn", ioctl_str[count].str, arg);
        else
                pr_debug("ioctl 0x%x unknown, arg=0x%lx\n", cmd, arg);
                pr_debug("ioctl %s, arg=0x%lxn", ioctl_str[count].str, arg);
        else
                pr_debug("ioctl 0x%x unknown, arg=0x%lx\n", cmd, arg);
index da9728e17727a9a60d3d1d9cb1ca79f8725c6820..d459bdb14154e9c11907ae8e8cd7e1a386c31a53 100644 (file)
@@ -1381,11 +1381,11 @@ static int vrc5477_ac97_ioctl(struct inode *inode, struct file *file,
        int val, ret;
 
 #ifdef VRC5477_AC97_DEBUG
        int val, ret;
 
 #ifdef VRC5477_AC97_DEBUG
-       for (count=0; count<sizeof(ioctl_str)/sizeof(ioctl_str[0]); count++) {
+       for (count = 0; count < ARRAY_SIZE(ioctl_str); count++) {
                if (ioctl_str[count].cmd == cmd)
                        break;
        }
                if (ioctl_str[count].cmd == cmd)
                        break;
        }
-       if (count < sizeof(ioctl_str)/sizeof(ioctl_str[0]))
+       if (count < ARRAY_SIZE(ioctl_str))
                printk(KERN_INFO PFX "ioctl %s\n", ioctl_str[count].str);
        else
                printk(KERN_INFO PFX "ioctl unknown, 0x%x\n", cmd);
                printk(KERN_INFO PFX "ioctl %s\n", ioctl_str[count].str);
        else
                printk(KERN_INFO PFX "ioctl unknown, 0x%x\n", cmd);
index 471c274c5000e5ebe1dd0f69c5d4e8c57a51c556..9f7e5f59ac82b3560d1717b8840aa0e2d840b789 100644 (file)
@@ -77,6 +77,7 @@
 #include <linux/poll.h>
 #include <linux/smp_lock.h>
 #include <linux/mutex.h>
 #include <linux/poll.h>
 #include <linux/smp_lock.h>
 #include <linux/mutex.h>
+#include <linux/kernel.h>
 
 #include <asm/byteorder.h>
 #include <asm/dma.h>
 
 #include <asm/byteorder.h>
 #include <asm/dma.h>
@@ -2676,7 +2677,7 @@ static int __init cs4297a_init(void)
 #if 0
                 val = SOUND_MASK_LINE;
                 mixer_ioctl(s, SOUND_MIXER_WRITE_RECSRC, (unsigned long) &val);
 #if 0
                 val = SOUND_MASK_LINE;
                 mixer_ioctl(s, SOUND_MIXER_WRITE_RECSRC, (unsigned long) &val);
-                for (i = 0; i < sizeof(initvol) / sizeof(initvol[0]); i++) {
+                for (i = 0; i < ARRAY_SIZE(initvol); i++) {
                         val = initvol[i].vol;
                         mixer_ioctl(s, initvol[i].mixch, (unsigned long) &val);
                 }
                         val = initvol[i].vol;
                         mixer_ioctl(s, initvol[i].mixch, (unsigned long) &val);
                 }