1. 01 Jun, 2013 2 commits
    • Stephen Warren's avatar
      spi: fix incorrect handling of min param in SPI_BPW_RANGE_MASK · eca8960a
      Stephen Warren authored
      SPI_BPW_RANGE_MASK is intended to work by calculating two masks; one
      representing support for all bits up-to-and-including the "max" supported
      value, and one representing support for all bits up-to-but-not-including
      the "min" supported value, and then taking the difference between the
      two, resulting in a mask representing support for all bits between
      (inclusive) the min and max values.
      
      However, the second mask ended up representing all bits up-to-and-
      including rather up-to-but-not-including. Fix this bug.
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      Signed-off-by: default avatarMark Brown <broonie@linaro.org>
      eca8960a
    • Stephen Warren's avatar
      spi: fix undefined behaviour in SPI_BPW_RANGE_MASK · 4dd9572a
      Stephen Warren authored
      The parameters to SPI_BPW_RANGE_MASK() are in the range 1..32. If 32 is
      used as a parameter, part of the expression is "1 << 32". Since 32 is >=
      the size of the type in use, such a shift is undefined behaviour. Add
      macro SPI_BIT_MASK to Implement a special case and thus avoid undefined
      behaviour. Use this new macro rather than BIT() when implementing
      SPI_BPW_RANGE_MASK().
      
      This fixes build warnings such as:
      drivers/spi/spi-gpio.c:446:2: warning: left shift count >= width of type [enabled by default]
      
      SPI_BPW_MASK() already avoids this, since its parameter is also in range
      1..32, yet it only shifts by up to one less than the input parameter.
      Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      Signed-off-by: default avatarMark Brown <broonie@linaro.org>
      4dd9572a
  2. 30 May, 2013 1 commit
    • Sachin Kamat's avatar
      spi: spi-imx: Fix compilation error · 6051426f
      Sachin Kamat authored
      Fix compilation error due to a typo introduced by commit 24778be2
      ("spi: convert drivers to use bits_per_word_mask"). Without this patch
      we get the following build errors:
      
      drivers/spi/spi-imx.c: In function ‘spi_imx_setupxfer’:
      drivers/spi/spi-imx.c:703:2: warning: no return statement in function returning non-void [-Wreturn-type]
      drivers/spi/spi-imx.c: At top level:
      drivers/spi/spi-imx.c:705:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘->’ token
      drivers/spi/spi-imx.c:707:2: error: expected identifier or ‘(’ before ‘return’
      drivers/spi/spi-imx.c:708:1: error: expected identifier or ‘(’ before ‘}’ token
      Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
      Cc: Stephen Warren <swarren@wwwdotorg.org>
      Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      6051426f
  3. 29 May, 2013 1 commit
  4. 22 May, 2013 1 commit
  5. 20 May, 2013 10 commits
  6. 19 May, 2013 3 commits
  7. 18 May, 2013 22 commits