Commit f7e8d9f830b118cfe757140d910834afd1710001

Authored by David S. Miller
1 parent 1df35f80f9

qlogicpti: Fix build warning.

The build warns:

drivers/scsi/qlogicpti.c: In function 'qpti_sbus_probe':
drivers/scsi/qlogicpti.c:1316:45: warning: passing argument 1 of 'scsi_host_alloc' discards 'const' qualifier from pointer target type [enabled by default]
include/scsi/scsi_host.h:778:26: note: expected 'struct scsi_host_template *' but argument is of type 'const struct scsi_host_template *'

The problem is that of_device_id->data is a const void pointer.

This is pretty silly in this specific instance, because for all
matched device IDs we set match->data to the same value,
&qpti_template.

So just use that directly instead of the unnecessary and improperly
typed abstraction.

Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 1 additions and 12 deletions Side-by-side Diff

drivers/scsi/qlogicpti.c
... ... @@ -1294,26 +1294,19 @@
1294 1294 static const struct of_device_id qpti_match[];
1295 1295 static int __devinit qpti_sbus_probe(struct platform_device *op)
1296 1296 {
1297   - const struct of_device_id *match;
1298   - struct scsi_host_template *tpnt;
1299 1297 struct device_node *dp = op->dev.of_node;
1300 1298 struct Scsi_Host *host;
1301 1299 struct qlogicpti *qpti;
1302 1300 static int nqptis;
1303 1301 const char *fcode;
1304 1302  
1305   - match = of_match_device(qpti_match, &op->dev);
1306   - if (!match)
1307   - return -EINVAL;
1308   - tpnt = match->data;
1309   -
1310 1303 /* Sometimes Antares cards come up not completely
1311 1304 * setup, and we get a report of a zero IRQ.
1312 1305 */
1313 1306 if (op->archdata.irqs[0] == 0)
1314 1307 return -ENODEV;
1315 1308  
1316   - host = scsi_host_alloc(tpnt, sizeof(struct qlogicpti));
  1309 + host = scsi_host_alloc(&qpti_template, sizeof(struct qlogicpti));
1317 1310 if (!host)
1318 1311 return -ENOMEM;
1319 1312  
1320 1313  
1321 1314  
1322 1315  
... ... @@ -1445,19 +1438,15 @@
1445 1438 static const struct of_device_id qpti_match[] = {
1446 1439 {
1447 1440 .name = "ptisp",
1448   - .data = &qpti_template,
1449 1441 },
1450 1442 {
1451 1443 .name = "PTI,ptisp",
1452   - .data = &qpti_template,
1453 1444 },
1454 1445 {
1455 1446 .name = "QLGC,isp",
1456   - .data = &qpti_template,
1457 1447 },
1458 1448 {
1459 1449 .name = "SUNW,isp",
1460   - .data = &qpti_template,
1461 1450 },
1462 1451 {},
1463 1452 };