X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmtd%2Fmaps%2Fdilnetpc.c;fp=drivers%2Fmtd%2Fmaps%2Fdilnetpc.c;h=b51c757817d819c3cc4352ed773df591a905222d;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=b1104fe1f20723a4dfaca7400efc6d0e85bdab0b;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/drivers/mtd/maps/dilnetpc.c b/drivers/mtd/maps/dilnetpc.c index b1104fe1f..b51c75781 100644 --- a/drivers/mtd/maps/dilnetpc.c +++ b/drivers/mtd/maps/dilnetpc.c @@ -25,6 +25,7 @@ * and http://www.ssv-embedded.de/ssv/pc104/p170.htm */ +#include #include #include #include @@ -217,8 +218,8 @@ static void dnp_set_vpp(struct map_info *not_used, int on) { if(--vpp_counter == 0) setcsc(CSC_RBWR, getcsc(CSC_RBWR) | 0x4); - else - BUG_ON(vpp_counter < 0); + else if(vpp_counter < 0) + BUG(); } spin_unlock_irq(&dnpc_spin); } @@ -239,8 +240,8 @@ static void adnp_set_vpp(struct map_info *not_used, int on) { if(--vpp_counter == 0) setcsc(CSC_RBWR, getcsc(CSC_RBWR) | 0x8); - else - BUG_ON(vpp_counter < 0); + else if(vpp_counter < 0) + BUG(); } spin_unlock_irq(&dnpc_spin); } @@ -299,7 +300,7 @@ static struct mtd_partition partition_info[]= }, }; -#define NUM_PARTITIONS ARRAY_SIZE(partition_info) +#define NUM_PARTITIONS (sizeof(partition_info)/sizeof(partition_info[0])) static struct mtd_info *mymtd; static struct mtd_info *lowlvl_parts[NUM_PARTITIONS]; @@ -344,7 +345,7 @@ static struct mtd_partition higlvl_partition_info[]= }, }; -#define NUM_HIGHLVL_PARTITIONS ARRAY_SIZE(higlvl_partition_info) +#define NUM_HIGHLVL_PARTITIONS (sizeof(higlvl_partition_info)/sizeof(partition_info[0])) static int dnp_adnp_probe(void)