sparc64: Fix sparse warnings in prom.c

1) Testing null with '0'
2) returning void-valued expression

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2008-09-11 23:52:35 -07:00
parent 7e0b1e6186
commit c91e2ecad0

View File

@ -38,7 +38,7 @@ struct device_node *of_find_node_by_phandle(phandle handle)
{ {
struct device_node *np; struct device_node *np;
for (np = allnodes; np != 0; np = np->allnext) for (np = allnodes; np; np = np->allnext)
if (np->node == handle) if (np->node == handle)
break; break;
@ -1043,22 +1043,30 @@ static void __init irq_trans_init(struct device_node *dp)
for (i = 0; i < ARRAY_SIZE(pci_irq_trans_table); i++) { for (i = 0; i < ARRAY_SIZE(pci_irq_trans_table); i++) {
struct irq_trans *t = &pci_irq_trans_table[i]; struct irq_trans *t = &pci_irq_trans_table[i];
if (!strcmp(model, t->name)) if (!strcmp(model, t->name)) {
return t->init(dp); t->init(dp);
return;
}
} }
} }
#endif #endif
#ifdef CONFIG_SBUS #ifdef CONFIG_SBUS
if (!strcmp(dp->name, "sbus") || if (!strcmp(dp->name, "sbus") ||
!strcmp(dp->name, "sbi")) !strcmp(dp->name, "sbi")) {
return sbus_irq_trans_init(dp); sbus_irq_trans_init(dp);
return;
}
#endif #endif
if (!strcmp(dp->name, "fhc") && if (!strcmp(dp->name, "fhc") &&
!strcmp(dp->parent->name, "central")) !strcmp(dp->parent->name, "central")) {
return central_irq_trans_init(dp); central_irq_trans_init(dp);
return;
}
if (!strcmp(dp->name, "virtual-devices") || if (!strcmp(dp->name, "virtual-devices") ||
!strcmp(dp->name, "niu")) !strcmp(dp->name, "niu")) {
return sun4v_vdev_irq_trans_init(dp); sun4v_vdev_irq_trans_init(dp);
return;
}
} }
static int is_root_node(const struct device_node *dp) static int is_root_node(const struct device_node *dp)
@ -1329,32 +1337,49 @@ static void __init __build_path_component(struct device_node *dp, char *tmp_buf)
if (parent != NULL) { if (parent != NULL) {
if (!strcmp(parent->type, "pci") || if (!strcmp(parent->type, "pci") ||
!strcmp(parent->type, "pciex")) !strcmp(parent->type, "pciex")) {
return pci_path_component(dp, tmp_buf); pci_path_component(dp, tmp_buf);
if (!strcmp(parent->type, "sbus")) return;
return sbus_path_component(dp, tmp_buf); }
if (!strcmp(parent->type, "upa")) if (!strcmp(parent->type, "sbus")) {
return upa_path_component(dp, tmp_buf); sbus_path_component(dp, tmp_buf);
if (!strcmp(parent->type, "ebus")) return;
return ebus_path_component(dp, tmp_buf); }
if (!strcmp(parent->type, "upa")) {
upa_path_component(dp, tmp_buf);
return;
}
if (!strcmp(parent->type, "ebus")) {
ebus_path_component(dp, tmp_buf);
return;
}
if (!strcmp(parent->name, "usb") || if (!strcmp(parent->name, "usb") ||
!strcmp(parent->name, "hub")) !strcmp(parent->name, "hub")) {
return usb_path_component(dp, tmp_buf); usb_path_component(dp, tmp_buf);
if (!strcmp(parent->type, "i2c")) return;
return i2c_path_component(dp, tmp_buf); }
if (!strcmp(parent->type, "firewire")) if (!strcmp(parent->type, "i2c")) {
return ieee1394_path_component(dp, tmp_buf); i2c_path_component(dp, tmp_buf);
if (!strcmp(parent->type, "virtual-devices")) return;
return vdev_path_component(dp, tmp_buf); }
if (!strcmp(parent->type, "firewire")) {
ieee1394_path_component(dp, tmp_buf);
return;
}
if (!strcmp(parent->type, "virtual-devices")) {
vdev_path_component(dp, tmp_buf);
return;
}
/* "isa" is handled with platform naming */ /* "isa" is handled with platform naming */
} }
/* Use platform naming convention. */ /* Use platform naming convention. */
if (tlb_type == hypervisor) if (tlb_type == hypervisor) {
return sun4v_path_component(dp, tmp_buf); sun4v_path_component(dp, tmp_buf);
else return;
return sun4u_path_component(dp, tmp_buf); } else {
sun4u_path_component(dp, tmp_buf);
}
} }
static char * __init build_path_component(struct device_node *dp) static char * __init build_path_component(struct device_node *dp)