1. 15 Mar, 2018 1 commit
    • Colin Ian King's avatar
      scsi: lpfc: make several unions static, fix non-ANSI prototype · fab2e466
      Colin Ian King authored
      There are several unions that are local to the source and do not need to
      be in global scope, so make them static. Also add in a missing void
      parameter to functions lpfc_nvme_cmd_template and
      lpfc_nvmet_cmd_template to clean up non-ANSI warning.
      
      Cleans up sparse warnings:
      drivers/scsi/lpfc/lpfc_nvme.c:68:19: warning: symbol
      'lpfc_iread_cmd_template' was not declared. Should it be static?
      drivers/scsi/lpfc/lpfc_nvme.c:69:19: warning: symbol
      'lpfc_iwrite_cmd_template' was not declared. Should it be static?
      drivers/scsi/lpfc/lpfc_nvme.c:70:19: warning: symbol
      'lpfc_icmnd_cmd_template' was not declared. Should it be static?
      drivers/scsi/lpfc/lpfc_nvme.c:74:24: warning: non-ANSI function
      'lpfc_tsend_cmd_template' was not declared. Should it be static?
      drivers/scsi/lpfc/lpfc_nvmet.c:78:19: warning: symbol
      'lpfc_treceive_cmd_template' was not declared. Should it be static?
      drivers/scsi/lpfc/lpfc_nvmet.c:79:19: warning: symbol
      'lpfc_trsp_cmd_template' was not declared. Should it be static?
      drivers/scsi/lpfc/lpfc_nvmet.c:83:25: warning: non-ANSI function
      declaration of function 'lpfc_nvmet_cmd_template'
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Acked-by: default avatarJames Smart <james.smart@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      fab2e466
  2. 13 Mar, 2018 24 commits
  3. 07 Mar, 2018 4 commits
  4. 06 Mar, 2018 1 commit
    • Arnd Bergmann's avatar
      scsi: mpt3sas: clarify mmio pointer types · 6f9e09fd
      Arnd Bergmann authored
      The newly added code mixes up phys_addr_t/resource_size_t with dma_addr_t
      and void pointers, as seen from these compiler warning:
      
      drivers/scsi/mpt3sas/mpt3sas_base.c: In function '_base_get_chain_phys':
      drivers/scsi/mpt3sas/mpt3sas_base.c:235:21: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
        base_chain_phys  = (void *)ioc->chip_phys + MPI_FRAME_START_OFFSET +
                           ^
      drivers/scsi/mpt3sas/mpt3sas_base.c: In function '_clone_sg_entries':
      drivers/scsi/mpt3sas/mpt3sas_base.c:427:20: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
          sgel->Address = (dma_addr_t)dst_addr_phys;
                          ^
      drivers/scsi/mpt3sas/mpt3sas_base.c:438:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
             (dma_addr_t)buff_ptr_phys;
             ^
      drivers/scsi/mpt3sas/mpt3sas_base.c:444:10: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
                (dma_addr_t)buff_ptr_phys;
      
      Both dma_addr_t and phys_addr_t may be wider than a pointer, so we must
      avoid the conversion to pointer types. This also helps readability.
      
      A second problem is treating MMIO addresses from a 'struct resource'
      as addresses that can be used for DMA on that device. In almost all
      cases, those are the same, but on some of the more obscure architectures,
      PCI memory address 0 is mapped into the CPU address space at a nonzero
      offset. I don't have a good fix for that, so I'm adding a comment here,
      plus a WARN_ON() that triggers whenever the phys_addr_t number is
      outside of the low 32-bit address space and causes a straight overflow
      when assigned to the 32-bit sgel->Address.
      
      Fixes: 182ac784 ("scsi: mpt3sas: Introduce Base function for cloning.")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarSreekanth Reddy <Sreekanth.Reddy@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      6f9e09fd
  5. 02 Mar, 2018 5 commits
  6. 28 Feb, 2018 5 commits