aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/hmc6352.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-09-12misc: hmc6352: fix potential Spectre v1Gustavo A. R. Silva1-0/+2
val is indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: drivers/misc/hmc6352.c:54 compass_store() warn: potential spectre issue 'map' [r] Fix this by sanitizing val before using it to index map Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: stable@vger.kernel.org Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-28misc: hmc6352: constify i2c_device_idArvind Yadav1-1/+1
i2c_device_id are not supposed to change at runtime. All functions working with i2c_device_id provided by <linux/i2c.h> work with const i2c_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-07drivers/misc: delete non-required instances of include <linux/init.h>Paul Gortmaker1-1/+0
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Cc: Arnd Bergmann <arnd@arndb.de> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-06misc: replace strict_strtoul() with kstrtoul()Jingoo Han1-2/+3
The usage of strict_strtoul() is not preferred, because strict_strtoul() is obsolete. Thus, kstrtoul() should be used. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-01-24MISC: convert drivers/misc/* to use module_i2c_driver()Axel Lin1-12/+1
This patch converts the drivers in drivers/misc/* to use the module_i2c_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Michael Hennerich <hennerich@blackfin.uclinux.org> Cc: Anantha Narayanan <Anantha.Narayanan@intel.com> Cc: Hemanth V <hemanthv@ti.com> Cc: Christoph Mair <christoph.mair@gmail.com> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Ben Gardner <bgardner@wabtec.com> Cc: Minkyu Kang <mk7.kang@samsung.com> Cc: Kalhan Trisal <kalhan.trisal@intel.com> Cc: Darrick J. Wong <djwong@us.ibm.com> Cc: Daniel Mack <zonque@gmail.com> Cc: Rodolfo Giometti <giometti@linux.it> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-22drivers/misc/hmc6352.c: fix wrong return value checking for i2c_master_recv()Axel Lin1-2/+2
i2c_master_recv() returns negative errno, or else the number of bytes read. Thus i2c_master_recv(client, i2c_data, 2) returns 2 instead of 1 in success case. [akpm@linux-foundation.org: make `ret' signed] Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Kalhan Trisal <kalhan.trisal@intel.com> Cc: Alan Cox <alan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-09hmc6352: add driver for the HMC6352 compassKalhan Trisal1-0/+166
This driver will report the heading values in degrees to the sysfs interface. The values returned are headings . e.g. 245.6 Alan: Cleanups requested now all folded in and a sysfs description to keep Andrew happy. The sysfs description now resembles hwmon. Signed-off-by: Kalhan Trisal <kalhan.trisal@intel.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>