aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-09-12 02:52:35 -0400
committerDavid S. Miller <davem@davemloft.net>2008-09-12 02:52:35 -0400
commitc91e2ecad0a392604ece6e53d38b484918060825 (patch)
treebd59a2a178be2df930f9d7257ea047f7b7311fbe /arch/sparc64
parent7e0b1e6186c755becf8b19c844c63db1a551898b (diff)
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>
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/kernel/prom.c85
1 files changed, 55 insertions, 30 deletions
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index 922dd612612e..5f50e2b17a8f 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -38,7 +38,7 @@ struct device_node *of_find_node_by_phandle(phandle handle)
38{ 38{
39 struct device_node *np; 39 struct device_node *np;
40 40
41 for (np = allnodes; np != 0; np = np->allnext) 41 for (np = allnodes; np; np = np->allnext)
42 if (np->node == handle) 42 if (np->node == handle)
43 break; 43 break;
44 44
@@ -1043,22 +1043,30 @@ static void __init irq_trans_init(struct device_node *dp)
1043 for (i = 0; i < ARRAY_SIZE(pci_irq_trans_table); i++) { 1043 for (i = 0; i < ARRAY_SIZE(pci_irq_trans_table); i++) {
1044 struct irq_trans *t = &pci_irq_trans_table[i]; 1044 struct irq_trans *t = &pci_irq_trans_table[i];
1045 1045
1046 if (!strcmp(model, t->name)) 1046 if (!strcmp(model, t->name)) {
1047 return t->init(dp); 1047 t->init(dp);
1048 return;
1049 }
1048 } 1050 }
1049 } 1051 }
1050#endif 1052#endif
1051#ifdef CONFIG_SBUS 1053#ifdef CONFIG_SBUS
1052 if (!strcmp(dp->name, "sbus") || 1054 if (!strcmp(dp->name, "sbus") ||
1053 !strcmp(dp->name, "sbi")) 1055 !strcmp(dp->name, "sbi")) {
1054 return sbus_irq_trans_init(dp); 1056 sbus_irq_trans_init(dp);
1057 return;
1058 }
1055#endif 1059#endif
1056 if (!strcmp(dp->name, "fhc") && 1060 if (!strcmp(dp->name, "fhc") &&
1057 !strcmp(dp->parent->name, "central")) 1061 !strcmp(dp->parent->name, "central")) {
1058 return central_irq_trans_init(dp); 1062 central_irq_trans_init(dp);
1063 return;
1064 }
1059 if (!strcmp(dp->name, "virtual-devices") || 1065 if (!strcmp(dp->name, "virtual-devices") ||
1060 !strcmp(dp->name, "niu")) 1066 !strcmp(dp->name, "niu")) {
1061 return sun4v_vdev_irq_trans_init(dp); 1067 sun4v_vdev_irq_trans_init(dp);
1068 return;
1069 }
1062} 1070}
1063 1071
1064static int is_root_node(const struct device_node *dp) 1072static 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)
1329 1337
1330 if (parent != NULL) { 1338 if (parent != NULL) {
1331 if (!strcmp(parent->type, "pci") || 1339 if (!strcmp(parent->type, "pci") ||
1332 !strcmp(parent->type, "pciex")) 1340 !strcmp(parent->type, "pciex")) {
1333 return pci_path_component(dp, tmp_buf); 1341 pci_path_component(dp, tmp_buf);
1334 if (!strcmp(parent->type, "sbus")) 1342 return;
1335 return sbus_path_component(dp, tmp_buf); 1343 }
1336 if (!strcmp(parent->type, "upa")) 1344 if (!strcmp(parent->type, "sbus")) {
1337 return upa_path_component(dp, tmp_buf); 1345 sbus_path_component(dp, tmp_buf);
1338 if (!strcmp(parent->type, "ebus")) 1346 return;
1339 return ebus_path_component(dp, tmp_buf); 1347 }
1348 if (!strcmp(parent->type, "upa")) {
1349 upa_path_component(dp, tmp_buf);
1350 return;
1351 }
1352 if (!strcmp(parent->type, "ebus")) {
1353 ebus_path_component(dp, tmp_buf);
1354 return;
1355 }
1340 if (!strcmp(parent->name, "usb") || 1356 if (!strcmp(parent->name, "usb") ||
1341 !strcmp(parent->name, "hub")) 1357 !strcmp(parent->name, "hub")) {
1342 return usb_path_component(dp, tmp_buf); 1358 usb_path_component(dp, tmp_buf);
1343 if (!strcmp(parent->type, "i2c")) 1359 return;
1344 return i2c_path_component(dp, tmp_buf); 1360 }
1345 if (!strcmp(parent->type, "firewire")) 1361 if (!strcmp(parent->type, "i2c")) {
1346 return ieee1394_path_component(dp, tmp_buf); 1362 i2c_path_component(dp, tmp_buf);
1347 if (!strcmp(parent->type, "virtual-devices")) 1363 return;
1348 return vdev_path_component(dp, tmp_buf); 1364 }
1349 1365 if (!strcmp(parent->type, "firewire")) {
1366 ieee1394_path_component(dp, tmp_buf);
1367 return;
1368 }
1369 if (!strcmp(parent->type, "virtual-devices")) {
1370 vdev_path_component(dp, tmp_buf);
1371 return;
1372 }
1350 /* "isa" is handled with platform naming */ 1373 /* "isa" is handled with platform naming */
1351 } 1374 }
1352 1375
1353 /* Use platform naming convention. */ 1376 /* Use platform naming convention. */
1354 if (tlb_type == hypervisor) 1377 if (tlb_type == hypervisor) {
1355 return sun4v_path_component(dp, tmp_buf); 1378 sun4v_path_component(dp, tmp_buf);
1356 else 1379 return;
1357 return sun4u_path_component(dp, tmp_buf); 1380 } else {
1381 sun4u_path_component(dp, tmp_buf);
1382 }
1358} 1383}
1359 1384
1360static char * __init build_path_component(struct device_node *dp) 1385static char * __init build_path_component(struct device_node *dp)