1. 23 Oct, 2016 2 commits
    • Arnd Bergmann's avatar
      iio: accel: sca3000_core: avoid potentially uninitialized variable · 64bc2d02
      Arnd Bergmann authored
      The newly added __sca3000_get_base_freq function handles all valid
      modes of the SCA3000_REG_ADDR_MODE register, but gcc notices
      that any other value (i.e. 0x00) causes the base_freq variable to
      not get initialized:
      
      drivers/staging/iio/accel/sca3000_core.c: In function 'sca3000_write_raw':
      drivers/staging/iio/accel/sca3000_core.c:527:23: error: 'base_freq' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      
      This adds explicit error handling for unexpected register values,
      to ensure this cannot happen.
      
      Fixes: e0f3fc9b ("iio: accel: sca3000_core: implemented IIO_CHAN_INFO_SAMP_FREQ")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Ico Doornekamp <ico@pruts.nl>
      Cc: Jonathan Cameron <jic23@kernel.org>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      64bc2d02
    • Sandhya Bankar's avatar
      iio:chemical:atlas-ph-sensor: Fix use of 32 bit int to hold 16 bit big endian value · d1fe85ec
      Sandhya Bankar authored
      This will result in a random value being reported on big endian architectures.
      (thanks to Lars-Peter Clausen for pointing out the effects of this bug)
      
      Only effects a value printed to the log, but as this reports the settings of
      the probe in question it may be of direct interest to users.
      
      Also, fixes the following sparse endianness warnings:
      
      drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
      drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
      drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
      drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
      drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
      drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
      drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
      drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
      Signed-off-by: default avatarSandhya Bankar <bankarsandhya512@gmail.com>
      Fixes: e8dd92bf ("iio: chemical: atlas-ph-sensor: add EC feature")
      Cc: <Stable@vger.kernel.org>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      d1fe85ec
  2. 09 Oct, 2016 1 commit
  3. 01 Oct, 2016 1 commit
    • sayli karnik's avatar
      iio: maxim_thermocouple: Align 16 bit big endian value of raw reads · 231147ee
      sayli karnik authored
      Driver was reporting invalid raw read values for MAX6675 on big
      endian architectures. MAX6675 buffered mode is not affected, nor
      is the MAX31855.
      
      The driver was losing a 2 byte read value when it used a 32 bit
      integer buffer to store a 16 bit big endian value. Use big endian
      types to properly align buffers on big endian architectures.
      
      Fixes following sparse endianness warnings:
      warning: cast to restricted __be16
      warning: cast to restricted __be32
      Fixes checkpatch issue:
      CHECK: No space is necessary after a cast
      Signed-off-by: default avatarsayli karnik <karniksayli1995@gmail.com>
      Fixes: 1f25ca11 ("iio: temperature: add support for Maxim
      thermocouple chips")
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      231147ee
  4. 25 Sep, 2016 36 commits