Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=37767b66ed61ee37f0d8f40523f74c31bc187d1d
Commit:     37767b66ed61ee37f0d8f40523f74c31bc187d1d
Parent:     cd438a58c89221d8642455d0cc8ec96d3b822f6e
Author:     Dmitry Torokhov <[EMAIL PROTECTED]>
AuthorDate: Mon May 21 00:18:08 2007 -0400
Committer:  Dmitry Torokhov <[EMAIL PROTECTED]>
CommitDate: Tue Jul 10 00:35:16 2007 -0400

    Input: aiptek - kill aiptek_convert_from_2s_complement()
    
    There is no reason to do that, just tell the compiler that
    we are dealing with signed values in buffer, that's it.
    
    Signed-off-by: Rene van Paassen <[EMAIL PROTECTED]>
    Signed-off-by: Dmitry Torokhov <[EMAIL PROTECTED]>
---
 drivers/input/tablet/aiptek.c |   24 ++----------------------
 1 files changed, 2 insertions(+), 22 deletions(-)

diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c
index 0c990e6..3a5e0aa 100644
--- a/drivers/input/tablet/aiptek.c
+++ b/drivers/input/tablet/aiptek.c
@@ -377,26 +377,6 @@ static const char *map_val_to_str(const struct aiptek_map 
*map, int val)
 }
 
 /***********************************************************************
- * Relative reports deliver values in 2's complement format to
- * deal with negative offsets.
- */
-static int aiptek_convert_from_2s_complement(unsigned char c)
-{
-       int ret;
-       unsigned char b = c;
-       int negate = 0;
-
-       if ((b & 0x80) != 0) {
-               b = ~b;
-               b--;
-               negate = 1;
-       }
-       ret = b;
-       ret = (negate == 1) ? -ret : ret;
-       return ret;
-}
-
-/***********************************************************************
  * aiptek_irq can receive one of six potential reports.
  * The documentation for each is in the body of the function.
  *
@@ -473,8 +453,8 @@ static void aiptek_irq(struct urb *urb)
                        aiptek->diagnostic =
                            AIPTEK_DIAGNOSTIC_SENDING_RELATIVE_IN_ABSOLUTE;
                } else {
-                       x = aiptek_convert_from_2s_complement(data[2]);
-                       y = aiptek_convert_from_2s_complement(data[3]);
+                       x = (signed char) data[2];
+                       y = (signed char) data[3];
 
                        /* jitterable keeps track of whether any button has 
been pressed.
                         * We're also using it to remap the physical mouse 
button mask
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to