diff options
author | Eric Moore <eric.moore@lsi.com> | 2007-09-29 12:16:28 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.localdomain> | 2007-10-12 14:52:11 -0400 |
commit | bc6e089a13a5c0ac36247616baecd6fc77405e7f (patch) | |
tree | 1550844191351e970b10c94379146f624e02f599 /drivers/message/fusion/mptspi.c | |
parent | e7eae9f6e94cd49261c2997b0b4f768c1351bc02 (diff) |
[SCSI] mpt fusion: Fix sparse warnings
List below is output from C=2 sparse compilation, which are fixed with
this patch.
1) mptspi: pg0 is defined in x86 version of include/asm/pgtable.h
2) mptsas: context imbalance in 'mptsas_probe' different lock contexts
for basic block
3) mptbase: from mpt_attach - cast adds address space to expression
4) mptbase: from mpt_do_upload - request[] is bad constant expression
Signed-off-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message/fusion/mptspi.c')
-rw-r--r-- | drivers/message/fusion/mptspi.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index 3c24928e3cec..ed6a778b6707 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c | |||
@@ -516,8 +516,8 @@ static int mptspi_read_spi_device_pg0(struct scsi_target *starget, | |||
516 | struct Scsi_Host *shost = dev_to_shost(&starget->dev); | 516 | struct Scsi_Host *shost = dev_to_shost(&starget->dev); |
517 | struct _MPT_SCSI_HOST *hd = shost_priv(shost); | 517 | struct _MPT_SCSI_HOST *hd = shost_priv(shost); |
518 | struct _MPT_ADAPTER *ioc = hd->ioc; | 518 | struct _MPT_ADAPTER *ioc = hd->ioc; |
519 | struct _CONFIG_PAGE_SCSI_DEVICE_0 *pg0; | 519 | struct _CONFIG_PAGE_SCSI_DEVICE_0 *spi_dev_pg0; |
520 | dma_addr_t pg0_dma; | 520 | dma_addr_t spi_dev_pg0_dma; |
521 | int size; | 521 | int size; |
522 | struct _x_config_parms cfg; | 522 | struct _x_config_parms cfg; |
523 | struct _CONFIG_PAGE_HEADER hdr; | 523 | struct _CONFIG_PAGE_HEADER hdr; |
@@ -535,8 +535,8 @@ static int mptspi_read_spi_device_pg0(struct scsi_target *starget, | |||
535 | size += 2048; | 535 | size += 2048; |
536 | */ | 536 | */ |
537 | 537 | ||
538 | pg0 = dma_alloc_coherent(&ioc->pcidev->dev, size, &pg0_dma, GFP_KERNEL); | 538 | spi_dev_pg0 = dma_alloc_coherent(&ioc->pcidev->dev, size, &spi_dev_pg0_dma, GFP_KERNEL); |
539 | if (pg0 == NULL) { | 539 | if (spi_dev_pg0 == NULL) { |
540 | starget_printk(MYIOC_s_ERR_FMT, starget, | 540 | starget_printk(MYIOC_s_ERR_FMT, starget, |
541 | "dma_alloc_coherent for parameters failed\n", ioc->name); | 541 | "dma_alloc_coherent for parameters failed\n", ioc->name); |
542 | return -EINVAL; | 542 | return -EINVAL; |
@@ -552,7 +552,7 @@ static int mptspi_read_spi_device_pg0(struct scsi_target *starget, | |||
552 | memset(&cfg, 0, sizeof(cfg)); | 552 | memset(&cfg, 0, sizeof(cfg)); |
553 | 553 | ||
554 | cfg.cfghdr.hdr = &hdr; | 554 | cfg.cfghdr.hdr = &hdr; |
555 | cfg.physAddr = pg0_dma; | 555 | cfg.physAddr = spi_dev_pg0_dma; |
556 | cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; | 556 | cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; |
557 | cfg.dir = 0; | 557 | cfg.dir = 0; |
558 | cfg.pageAddr = starget->id; | 558 | cfg.pageAddr = starget->id; |
@@ -562,12 +562,12 @@ static int mptspi_read_spi_device_pg0(struct scsi_target *starget, | |||
562 | goto out_free; | 562 | goto out_free; |
563 | } | 563 | } |
564 | err = 0; | 564 | err = 0; |
565 | memcpy(pass_pg0, pg0, size); | 565 | memcpy(pass_pg0, spi_dev_pg0, size); |
566 | 566 | ||
567 | mptspi_print_read_nego(hd, starget, le32_to_cpu(pg0->NegotiatedParameters)); | 567 | mptspi_print_read_nego(hd, starget, le32_to_cpu(spi_dev_pg0->NegotiatedParameters)); |
568 | 568 | ||
569 | out_free: | 569 | out_free: |
570 | dma_free_coherent(&ioc->pcidev->dev, size, pg0, pg0_dma); | 570 | dma_free_coherent(&ioc->pcidev->dev, size, spi_dev_pg0, spi_dev_pg0_dma); |
571 | return err; | 571 | return err; |
572 | } | 572 | } |
573 | 573 | ||
@@ -594,11 +594,11 @@ static u32 mptspi_getRP(struct scsi_target *starget) | |||
594 | static void mptspi_read_parameters(struct scsi_target *starget) | 594 | static void mptspi_read_parameters(struct scsi_target *starget) |
595 | { | 595 | { |
596 | int nego; | 596 | int nego; |
597 | struct _CONFIG_PAGE_SCSI_DEVICE_0 pg0; | 597 | struct _CONFIG_PAGE_SCSI_DEVICE_0 spi_dev_pg0; |
598 | 598 | ||
599 | mptspi_read_spi_device_pg0(starget, &pg0); | 599 | mptspi_read_spi_device_pg0(starget, &spi_dev_pg0); |
600 | 600 | ||
601 | nego = le32_to_cpu(pg0.NegotiatedParameters); | 601 | nego = le32_to_cpu(spi_dev_pg0.NegotiatedParameters); |
602 | 602 | ||
603 | spi_iu(starget) = (nego & MPI_SCSIDEVPAGE0_NP_IU) ? 1 : 0; | 603 | spi_iu(starget) = (nego & MPI_SCSIDEVPAGE0_NP_IU) ? 1 : 0; |
604 | spi_dt(starget) = (nego & MPI_SCSIDEVPAGE0_NP_DT) ? 1 : 0; | 604 | spi_dt(starget) = (nego & MPI_SCSIDEVPAGE0_NP_DT) ? 1 : 0; |