Skip to content
Snippets Groups Projects
  1. May 30, 2019
  2. Dec 16, 2018
  3. Jun 28, 2016
  4. Oct 28, 2015
  5. Jan 26, 2015
    • Rasmus Villemoes's avatar
      hwmon: (ad7314) Do proper sign extension · 984faa1f
      Rasmus Villemoes authored
      
      The comment above (data << 2) >> 2 explains what the intention is: To
      use bit 13 of the 14-bit value data as the sign bit. However, this
      doesn't work due to C's promotion rules. data has type s16, but data
      << 2 has type int. To get sign extension, that expression would have
      to be cast back to an s16 before being shifted (at which point C's
      promotion rules would then kick in again and promote the left operand
      to int). As it stands, both expressions are no-ops for any value of
      data.
      
      Avoid these subtleties by using the existing API for
      this. sign_extend32 works equally well for 8 and 16 bit types.
      
      Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      984faa1f
  6. Apr 08, 2013
  7. Nov 28, 2012
  8. Sep 24, 2012
  9. Sep 18, 2012
  10. May 21, 2012
  11. Apr 23, 2012
    • Guenter Roeck's avatar
      hwmon: (ad7314) Fix build warning · eae1415d
      Guenter Roeck authored
      
      The following build warning is seen in some configurations.
      
      drivers/hwmon/ad7314.c: In function 'ad7314_show_temperature':
      drivers/hwmon/ad7314.c:70: warning: 'data' may be used uninitialized in this function
      
      Fix by overloading the return value from ad7314_spi_read with both data and
      error code (the returned data is really u16 and needs to be converted into a
      signed value anyway).
      
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Cc: Jonathan Cameron <jic23@cam.ac.uk>
      Acked-by: default avatarJean Delvare <khali@linux-fr.org>
      eae1415d
  12. Apr 04, 2012
  13. Mar 19, 2012
  14. Nov 25, 2011
    • Lars-Peter Clausen's avatar
      hwmon: Remove redundant spi driver bus initialization · b52fabca
      Lars-Peter Clausen authored
      
      In ancient times it was necessary to manually initialize the bus field of an
      spi_driver to spi_bus_type. These days this is done in spi_register_driver(),
      so we can drop the manual assignment.
      
      The patch was generated using the following coccinelle semantic patch:
      // <smpl>
      @@
      identifier _driver;
      @@
      struct spi_driver _driver = {
      	.driver = {
      -		.bus = &spi_bus_type,
      	},
      };
      // </smpl>
      
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Cc: Jean Delvare <khali@linux-fr.org>
      Cc: Guenter Roeck <guenter.roeck@ericsson.com>
      Cc: lm-sensors@lm-sensors.org
      Signed-off-by: default avatarGuenter Roeck <guenter.roeck@ericsson.com>
      b52fabca
  15. Oct 24, 2011
Loading