[svn-commits] sruffell: linux/trunk r6982 - /linux/trunk/drivers/dahdi/wctdm24xxp/base.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Thu Aug 13 09:42:12 CDT 2009
Author: sruffell
Date: Thu Aug 13 09:42:08 2009
New Revision: 6982
URL: http://svn.asterisk.org/svn-view/dahdi?view=rev&rev=6982
Log:
wctdm24xxp: Use the ARRAY_SIZE macro where appropriate.
Modified:
linux/trunk/drivers/dahdi/wctdm24xxp/base.c
Modified: linux/trunk/drivers/dahdi/wctdm24xxp/base.c
URL: http://svn.asterisk.org/svn-view/dahdi/linux/trunk/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=6982&r1=6981&r2=6982
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wctdm24xxp/base.c Thu Aug 13 09:42:08 2009
@@ -1084,7 +1084,7 @@
static unsigned char translate_3215(unsigned char address)
{
int x;
- for (x=0;x<sizeof(indirect_regs)/sizeof(indirect_regs[0]);x++) {
+ for (x = 0; x < ARRAY_SIZE(indirect_regs); x++) {
if (indirect_regs[x].address == address) {
address = indirect_regs[x].altaddr;
break;
@@ -1141,7 +1141,7 @@
{
unsigned char i;
- for (i=0; i<sizeof(indirect_regs) / sizeof(indirect_regs[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(indirect_regs); i++)
{
if(wctdm_proslic_setreg_indirect(wc, card, indirect_regs[i].address,indirect_regs[i].initial))
return -1;
@@ -1156,7 +1156,7 @@
unsigned short i, initial;
int j;
- for (i=0; i<sizeof(indirect_regs) / sizeof(indirect_regs[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(indirect_regs); i++)
{
if((j = wctdm_proslic_getreg_indirect(wc, card, (unsigned char) indirect_regs[i].address)) < 0) {
printk(KERN_NOTICE "Failed to read indirect register %d\n", i);
@@ -3688,7 +3688,7 @@
{
unsigned int x;
- for (x = 0; x < sizeof(wc->chans)/sizeof(wc->chans[0]); x++) {
+ for (x = 0; x < ARRAY_SIZE(wc->chans); x++) {
if (wc->chans[x]) {
kfree(wc->chans[x]);
}
@@ -3881,15 +3881,15 @@
int res;
int x;
- for (x = 0; x < (sizeof(fxo_modes) / sizeof(fxo_modes[0])); x++) {
+ for (x = 0; x < ARRAY_SIZE(fxo_modes); x++) {
if (!strcmp(fxo_modes[x].name, opermode))
break;
}
- if (x < sizeof(fxo_modes) / sizeof(fxo_modes[0])) {
+ if (x < ARRAY_SIZE(fxo_modes)) {
_opermode = x;
} else {
printk(KERN_NOTICE "Invalid/unknown operating mode '%s' specified. Please choose one of:\n", opermode);
- for (x = 0; x < sizeof(fxo_modes) / sizeof(fxo_modes[0]); x++)
+ for (x = 0; x < ARRAY_SIZE(fxo_modes); x++)
printk(KERN_NOTICE " %s\n", fxo_modes[x].name);
printk(KERN_NOTICE "Note this option is CASE SENSITIVE!\n");
return -ENODEV;
More information about the svn-commits
mailing list