diff --git a/modules/mqnic/mqnic_if.c b/modules/mqnic/mqnic_if.c index b759623b2..197f46965 100644 --- a/modules/mqnic/mqnic_if.c +++ b/modules/mqnic/mqnic_if.c @@ -69,7 +69,7 @@ int mqnic_create_interface(struct mqnic_dev *mdev, struct mqnic_if **interface_p } dev_info(dev, "Interface-level register blocks:"); - for (rb = interface->rb_list; rb->type && rb->version; rb++) + for (rb = interface->rb_list; rb->regs; rb++) dev_info(dev, " type 0x%08x (v %d.%d.%d.%d)", rb->type, rb->version >> 24, (rb->version >> 16) & 0xff, (rb->version >> 8) & 0xff, rb->version & 0xff); diff --git a/modules/mqnic/mqnic_main.c b/modules/mqnic/mqnic_main.c index b4705adaa..abb699861 100644 --- a/modules/mqnic/mqnic_main.c +++ b/modules/mqnic/mqnic_main.c @@ -274,7 +274,7 @@ static int mqnic_common_probe(struct mqnic_dev *mqnic) } dev_info(dev, "Device-level register blocks:"); - for (rb = mqnic->rb_list; rb->type && rb->version; rb++) + for (rb = mqnic->rb_list; rb->regs; rb++) dev_info(dev, " type 0x%08x (v %d.%d.%d.%d)", rb->type, rb->version >> 24, (rb->version >> 16) & 0xff, (rb->version >> 8) & 0xff, rb->version & 0xff); diff --git a/modules/mqnic/mqnic_sched_block.c b/modules/mqnic/mqnic_sched_block.c index 8807c8bb5..a9548892b 100644 --- a/modules/mqnic/mqnic_sched_block.c +++ b/modules/mqnic/mqnic_sched_block.c @@ -70,12 +70,12 @@ int mqnic_create_sched_block(struct mqnic_if *interface, struct mqnic_sched_bloc } dev_info(dev, "Scheduler block-level register blocks:"); - for (rb = block->rb_list; rb->type && rb->version; rb++) + for (rb = block->rb_list; rb->regs; rb++) dev_info(dev, " type 0x%08x (v %d.%d.%d.%d)", rb->type, rb->version >> 24, (rb->version >> 16) & 0xff, (rb->version >> 8) & 0xff, rb->version & 0xff); block->sched_count = 0; - for (rb = block->rb_list; rb->type && rb->version; rb++) { + for (rb = block->rb_list; rb->regs; rb++) { if (rb->type == MQNIC_RB_SCHED_RR_TYPE && rb->version == MQNIC_RB_SCHED_RR_VER) { ret = mqnic_create_scheduler(block, &block->sched[block->sched_count], block->sched_count, rb); diff --git a/utils/mqnic-dump.c b/utils/mqnic-dump.c index e93221c6e..41429e530 100644 --- a/utils/mqnic-dump.c +++ b/utils/mqnic-dump.c @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) printf("RAM region size: %lu\n", dev->ram_size); printf("Device-level register blocks:\n"); - for (struct reg_block *rb = dev->rb_list; rb->type && rb->version; rb++) + for (struct reg_block *rb = dev->rb_list; rb->regs; rb++) printf(" type 0x%08x (v %d.%d.%d.%d)\n", rb->type, rb->version >> 24, (rb->version >> 16) & 0xff, (rb->version >> 8) & 0xff, rb->version & 0xff); @@ -138,7 +138,7 @@ int main(int argc, char *argv[]) mqnic_reg_read32(dev->phc_rb->regs, MQNIC_RB_PHC_REG_NOM_PERIOD_FNS)); ch = 0; - for (struct reg_block *rb = dev->rb_list; rb->type && rb->version; rb++) + for (struct reg_block *rb = dev->rb_list; rb->regs; rb++) { if (rb->type == MQNIC_RB_PHC_PEROUT_TYPE && rb->version == MQNIC_RB_PHC_PEROUT_VER) { @@ -174,7 +174,7 @@ int main(int argc, char *argv[]) } printf("Interface-level register blocks:\n"); - for (struct reg_block *rb = dev_interface->rb_list; rb->type && rb->version; rb++) + for (struct reg_block *rb = dev_interface->rb_list; rb->regs; rb++) printf(" type 0x%08x (v %d.%d.%d.%d)\n", rb->type, rb->version >> 24, (rb->version >> 16) & 0xff, (rb->version >> 8) & 0xff, rb->version & 0xff); @@ -233,13 +233,13 @@ int main(int argc, char *argv[]) } printf("Scheduler block-level register blocks:\n"); - for (struct reg_block *rb = dev_sched_block->rb_list; rb->type && rb->version; rb++) + for (struct reg_block *rb = dev_sched_block->rb_list; rb->regs; rb++) printf(" type 0x%08x (v %d.%d.%d.%d)\n", rb->type, rb->version >> 24, (rb->version >> 16) & 0xff, (rb->version >> 8) & 0xff, rb->version & 0xff); printf("Sched count: %d\n", dev_sched_block->sched_count); - for (struct reg_block *rb = dev_sched_block->rb_list; rb->type && rb->version; rb++) + for (struct reg_block *rb = dev_sched_block->rb_list; rb->regs; rb++) { if (rb->type == MQNIC_RB_SCHED_RR_TYPE && rb->version == MQNIC_RB_SCHED_RR_VER) {