diff options
author | Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> | 2010-08-20 03:24:31 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-24 09:20:38 -0400 |
commit | b197cba071ec8a171fbaaaf82d119315a6f6cb0b (patch) | |
tree | 138f70c7214eaab532898aba31c45b72f8104dff | |
parent | 45b7c981aeeb456d4b0c04f15d551f3e515bf20e (diff) |
i7core_edac: Reduce args of i7core_get_onedevice
Since we need to pass the index of the entry, pass the table itself
instead of passing individual members of the table.
While here make it static.
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/edac/i7core_edac.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index d64ac2ccc0bc..567ee18d9d3f 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c | |||
@@ -1300,12 +1300,13 @@ static unsigned i7core_pci_lastbus(void) | |||
1300 | * | 1300 | * |
1301 | * Need to 'get' device 16 func 1 and func 2 | 1301 | * Need to 'get' device 16 func 1 and func 2 |
1302 | */ | 1302 | */ |
1303 | int i7core_get_onedevice(struct pci_dev **prev, const int devno, | 1303 | static int i7core_get_onedevice(struct pci_dev **prev, |
1304 | const struct pci_id_descr *dev_descr, | 1304 | const struct pci_id_table *table, |
1305 | const unsigned n_devs, | 1305 | const unsigned devno, |
1306 | const unsigned last_bus) | 1306 | const unsigned last_bus) |
1307 | { | 1307 | { |
1308 | struct i7core_dev *i7core_dev; | 1308 | struct i7core_dev *i7core_dev; |
1309 | const struct pci_id_descr *dev_descr = &table->descr[devno]; | ||
1309 | 1310 | ||
1310 | struct pci_dev *pdev = NULL; | 1311 | struct pci_dev *pdev = NULL; |
1311 | u8 bus = 0; | 1312 | u8 bus = 0; |
@@ -1357,14 +1358,14 @@ int i7core_get_onedevice(struct pci_dev **prev, const int devno, | |||
1357 | i7core_dev = kzalloc(sizeof(*i7core_dev), GFP_KERNEL); | 1358 | i7core_dev = kzalloc(sizeof(*i7core_dev), GFP_KERNEL); |
1358 | if (!i7core_dev) | 1359 | if (!i7core_dev) |
1359 | return -ENOMEM; | 1360 | return -ENOMEM; |
1360 | i7core_dev->pdev = kzalloc(sizeof(*i7core_dev->pdev) * n_devs, | 1361 | i7core_dev->pdev = kzalloc(sizeof(*i7core_dev->pdev) |
1361 | GFP_KERNEL); | 1362 | * table->n_devs, GFP_KERNEL); |
1362 | if (!i7core_dev->pdev) { | 1363 | if (!i7core_dev->pdev) { |
1363 | kfree(i7core_dev); | 1364 | kfree(i7core_dev); |
1364 | return -ENOMEM; | 1365 | return -ENOMEM; |
1365 | } | 1366 | } |
1366 | i7core_dev->socket = socket; | 1367 | i7core_dev->socket = socket; |
1367 | i7core_dev->n_devs = n_devs; | 1368 | i7core_dev->n_devs = table->n_devs; |
1368 | list_add_tail(&i7core_dev->list, &i7core_edac_list); | 1369 | list_add_tail(&i7core_dev->list, &i7core_edac_list); |
1369 | } | 1370 | } |
1370 | 1371 | ||
@@ -1416,18 +1417,14 @@ static int i7core_get_devices(const struct pci_id_table *table) | |||
1416 | { | 1417 | { |
1417 | int i, rc, last_bus; | 1418 | int i, rc, last_bus; |
1418 | struct pci_dev *pdev = NULL; | 1419 | struct pci_dev *pdev = NULL; |
1419 | const struct pci_id_descr *dev_descr; | ||
1420 | 1420 | ||
1421 | last_bus = i7core_pci_lastbus(); | 1421 | last_bus = i7core_pci_lastbus(); |
1422 | 1422 | ||
1423 | while (table && table->descr) { | 1423 | while (table && table->descr) { |
1424 | dev_descr = table->descr; | ||
1425 | for (i = 0; i < table->n_devs; i++) { | 1424 | for (i = 0; i < table->n_devs; i++) { |
1426 | pdev = NULL; | 1425 | pdev = NULL; |
1427 | do { | 1426 | do { |
1428 | rc = i7core_get_onedevice(&pdev, i, | 1427 | rc = i7core_get_onedevice(&pdev, table, i, |
1429 | &dev_descr[i], | ||
1430 | table->n_devs, | ||
1431 | last_bus); | 1428 | last_bus); |
1432 | if (rc < 0) { | 1429 | if (rc < 0) { |
1433 | if (i == 0) { | 1430 | if (i == 0) { |