+ hdapsc-inversion-of-each-axis.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     hdaps.c inversion of each axis

has been added to the -mm tree.  Its filename is

     hdapsc-inversion-of-each-axis.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: hdaps.c inversion of each axis
From: Michael Ruoss <miruoss@xxxxxxxxxxxxxxx>

Stolen from http://bugzilla.kernel.org/show_bug.cgi?id=7154, cleaned up a bit.

Cc: Jean Delvare <khali@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/hwmon/hdaps.c |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff -puN drivers/hwmon/hdaps.c~hdapsc-inversion-of-each-axis drivers/hwmon/hdaps.c
--- a/drivers/hwmon/hdaps.c~hdapsc-inversion-of-each-axis
+++ a/drivers/hwmon/hdaps.c
@@ -180,12 +180,11 @@ static int __hdaps_read_pair(unsigned in
 	km_activity = inb(HDAPS_PORT_KMACT);
 	__device_complete();
 
-	/* if hdaps_invert is set, negate the two values */
-	if (hdaps_invert) {
+	/* hdaps_invert is a bitvector. */
+	if ((hdaps_invert & 1) == 1)
 		*x = -*x;
+	if ((hdaps_invert & 2) == 2)
 		*y = -*y;
-	}
-
 	return 0;
 }
 
@@ -430,7 +429,7 @@ static ssize_t hdaps_calibrate_store(str
 static ssize_t hdaps_invert_show(struct device *dev,
 				 struct device_attribute *attr, char *buf)
 {
-	return sprintf(buf, "%u\n", hdaps_invert);
+        return sprintf(buf, "%u\n", hdaps_invert);
 }
 
 static ssize_t hdaps_invert_store(struct device *dev,
@@ -439,7 +438,7 @@ static ssize_t hdaps_invert_store(struct
 {
 	int invert;
 
-	if (sscanf(buf, "%d", &invert) != 1 || (invert != 1 && invert != 0))
+	if (sscanf(buf, "%d", &invert) != 1 || (invert < 0 || invert > 3))
 		return -EINVAL;
 
 	hdaps_invert = invert;
@@ -630,8 +629,8 @@ static void __exit hdaps_exit(void)
 module_init(hdaps_init);
 module_exit(hdaps_exit);
 
-module_param_named(invert, hdaps_invert, bool, 0);
-MODULE_PARM_DESC(invert, "invert data along each axis");
+module_param_named(invert, hdaps_invert, int, 0);
+MODULE_PARM_DESC(invert, "Invert data along axes. 1 inverts x-axis, 2 inverts y-axis, 3 inverts both axis.");
 
 MODULE_AUTHOR("Robert Love");
 MODULE_DESCRIPTION("IBM Hard Drive Active Protection System (HDAPS) driver");
_

Patches currently in -mm which might be from miruoss@xxxxxxxxxxxxxxx are


-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux