1. 24 Apr, 2017 3 commits
    • Arnd Bergmann's avatar
      scsi: pmcraid: fix endianess sparse annotations · 45c80be6
      Arnd Bergmann authored
      The use of le32_to_cpu() etc in this driver looks completely arbitrary.
      It may have made sense at some point, but it is not applied consistently,
      so this driver presumably won't work on big-endian kernel builds.
      
      Unfortunately it's unclear whether the type names or the calls to
      le32_to_cpu() are the correct ones. I'm taking educated guesses here
      and assume that most of the __le32 and __le16 annotations are correct,
      adding the conversion helpers whereever we access those fields.
      
      The exceptions are the 'fw_version' field that is always accessed as
      big-endian, so I'm changing the type here, and the 'hrrq' values that
      are accessed as little-endian, so I'm changing those the other way.
      
      None of these changes should have any effect on little-endian
      architectures like x86, but it addresses the sparse warnings.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      45c80be6
    • Arnd Bergmann's avatar
      scsi: pmcraid: use __iomem pointers for ioctl argument · 3397623b
      Arnd Bergmann authored
      kernelci.org reports a new compile warning for old code in the pmcraid
      driver:
      
      arch/mips/include/asm/uaccess.h:138:21: warning: passing argument 1 of '__access_ok' makes pointer from integer without a cast [-Wint-conversion]
      
      The warning got introduced by a cleanup to the access_ok() helper that
      requires the argument to be a pointer, where the old version silently
      accepts 'unsigned long' arguments as it still does on most other
      architectures.
      
      The new behavior in MIPS however seems absolutely sensible, and so far I
      could only find one other file with the same issue, so the best solution
      seems to be to clean up the pmcraid driver.
      
      This makes the driver consistently use 'void __iomem *' pointers for
      passing around the address of the user space ioctl arguments, which gets
      rid of the kernelci warning as well as several sparse warnings.
      
      Fixes: f0a955f4 ("mips: sanitize __access_ok()")
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      3397623b
    • Christoph Hellwig's avatar
      scsi: pmcraid: fix lock imbalance in pmcraid_reset_reload() · 91402608
      Christoph Hellwig authored
      sparse found a bug that has always been present since the driver was
      merged:
      
      drivers/scsi/pmcraid.c:2353:12: warning: context imbalance in 'pmcraid_reset_reload' - different lock contexts for basic block
      
      Fix this by using a common unlock goto label, and also reduce the
      indentation level in the function.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Reported-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      91402608
  2. 21 Apr, 2017 3 commits
  3. 20 Apr, 2017 3 commits
  4. 19 Apr, 2017 7 commits
  5. 14 Apr, 2017 20 commits
  6. 12 Apr, 2017 4 commits