Re: [Linuxwacom-devel] [PATCH] lib: use kernel flags if available

2012-10-12 Thread Jason Gerecke
On Fri, Oct 12, 2012 at 2:41 AM, Olivier Fourdan ofour...@redhat.com wrote:
 Peter Hutterer said the following on 10/12/2012 06:37 AM:

   [...]
 +   *builtin = (flag  (direct_flag | pointer_flag) ==
 direct_flag)

 +   ? IS_BUILTIN_TRUE : IS_BUILTIN_FALSE;
 please expand this to a normal condition - this is too nested to be
 easily readable.


 Updated patch attached. Got rid of the 2 additional vars as they did not
 really help with readability.

 Cheers,
 Olivier.


 + if (flag == (1  INPUT_PROP_DIRECT))
 + *builtin = IS_BUILTIN_TRUE;
 + else
 + *builtin = IS_BUILTIN_FALSE;
 +

Not quite correct, since there could be properties added in the future
whose bits we'd need to set in addition to INPUT_PROP_DIRECT. Third
time's the charm?

Jason

---
When you're rife with devastation / There's a simple explanation:
You're a toymaker's creation / Trapped inside a crystal ball.
And whichever way he tilts it / Know that we must be resilient
We won't let them break our spirits / As we sing our silly song.

--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] lib: use kernel flags if available

2012-10-12 Thread Olivier Fourdan
Jason Gerecke said the following on 10/12/2012 06:43 PM:
 On Fri, Oct 12, 2012 at 2:41 AM, Olivier Fourdanofour...@redhat.com  wrote:
 Peter Hutterer said the following on 10/12/2012 06:37 AM:
[...]
 +   *builtin = (flag   (direct_flag | pointer_flag) ==
 direct_flag)

 +   ? IS_BUILTIN_TRUE : IS_BUILTIN_FALSE;
 please expand this to a normal condition - this is too nested to be
 easily readable.

 Updated patch attached. Got rid of the 2 additional vars as they did not
 really help with readability.

 Cheers,
 Olivier.

 +if (flag == (1  INPUT_PROP_DIRECT))
 +*builtin = IS_BUILTIN_TRUE;
 +else
 +*builtin = IS_BUILTIN_FALSE;
 +
 Not quite correct, since there could be properties added in the future
 whose bits we'd need to set in addition to INPUT_PROP_DIRECT. Third
 time's the charm?

You may have cut too much out and missed the = on flag mask just 
before:

+   flag= (1  INPUT_PROP_DIRECT) | (1  
INPUT_PROP_POINTER);
+   if (flag == (1  INPUT_PROP_DIRECT))
+   *builtin = IS_BUILTIN_TRUE;
+   else
+   *builtin = IS_BUILTIN_FALSE;
+

So it should be correct :)

Cheers,
Olivier

--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] lib: use kernel flags if available

2012-10-12 Thread Jason Gerecke
On Fri, Oct 12, 2012 at 10:52 AM, Olivier Fourdan ofour...@redhat.com wrote:
 Jason Gerecke said the following on 10/12/2012 06:43 PM:

 On Fri, Oct 12, 2012 at 2:41 AM, Olivier Fourdanofour...@redhat.com
 wrote:

 Peter Hutterer said the following on 10/12/2012 06:37 AM:

[...]
 +   *builtin = (flag   (direct_flag | pointer_flag)
 ==
 direct_flag)

 +   ? IS_BUILTIN_TRUE :
 IS_BUILTIN_FALSE;
 please expand this to a normal condition - this is too nested to be
 easily readable.


 Updated patch attached. Got rid of the 2 additional vars as they did not
 really help with readability.

 Cheers,
 Olivier.

 +   if (flag == (1  INPUT_PROP_DIRECT))
 +   *builtin = IS_BUILTIN_TRUE;
 +   else
 +   *builtin = IS_BUILTIN_FALSE;
 +

 Not quite correct, since there could be properties added in the future
 whose bits we'd need to set in addition to INPUT_PROP_DIRECT. Third
 time's the charm?


 You may have cut too much out and missed the = on flag mask just before:

 +   flag= (1  INPUT_PROP_DIRECT) | (1
 INPUT_PROP_POINTER);

 +   if (flag == (1  INPUT_PROP_DIRECT))
 +   *builtin = IS_BUILTIN_TRUE;
 +   else
 +   *builtin = IS_BUILTIN_FALSE;
 +

 So it should be correct :)

 Cheers,
 Olivier

Whoops! You're right, of course :)

Jason

---
When you're rife with devastation / There's a simple explanation:
You're a toymaker's creation / Trapped inside a crystal ball.
And whichever way he tilts it / Know that we must be resilient
We won't let them break our spirits / As we sing our silly song.

--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 2/2] libwacom status LED helper functions - take 2

2012-10-12 Thread Jason Gerecke
Pushed to master.

Jason

---
When you're rife with devastation / There's a simple explanation:
You're a toymaker's creation / Trapped inside a crystal ball.
And whichever way he tilts it / Know that we must be resilient
We won't let them break our spirits / As we sing our silly song.


On Wed, Oct 3, 2012 at 11:37 AM, Jason Gerecke killert...@gmail.com wrote:
 For the set,

 Reviewed-by: Jason Gerecke killert...@gmail.com

 Jason

 ---
 When you're rife with devastation / There's a simple explanation:
 You're a toymaker's creation / Trapped inside a crystal ball.
 And whichever way he tilts it / Know that we must be resilient
 We won't let them break our spirits / As we sing our silly song.


 On Wed, Oct 3, 2012 at 6:58 AM, Olivier Fourdan ofour...@redhat.com wrote:
 Sorry, updated 2nd patch, meant to print StatusLEDs=, not just LEDs= in
 libwacom_print_device_description()

 --
 Don't let slow site performance ruin your business. Deploy New Relic APM
 Deploy New Relic app performance management and know exactly
 what is happening inside your Ruby, Python, PHP, Java, and .NET app
 Try New Relic at no cost today and get our sweet Data Nerd shirt too!
 http://p.sf.net/sfu/newrelic-dev2dev
 ___
 Linuxwacom-devel mailing list
 Linuxwacom-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 1/1] data: DTI 520 is a screen tablet, set BuiltIn to true

2012-10-12 Thread Jason Gerecke
On Tue, Oct 9, 2012 at 3:53 AM, Peter Hutterer peter.hutte...@who-t.net wrote:
 On Mon, Oct 08, 2012 at 05:36:06PM +0200, Olivier Fourdan wrote:


 From 63a1b7bdcbb4c2522a7b0b996b6a3890571154d6 Mon Sep 17 00:00:00 2001
 From: Olivier Fourdan ofour...@redhat.com
 Date: Mon, 8 Oct 2012 15:57:58 +0200
 Subject: [PATCH 1/1] data: DTI 520 is a screen tablet, set BuiltIn to true

 According the tablet definition and pictures of the DTI 520,
 this is a screen tablet therefore the BuiltIn flag should
 be true and not false.
 ---

Just need your S-O-B and I'll push this patch up :)

Jason

---
When you're rife with devastation / There's a simple explanation:
You're a toymaker's creation / Trapped inside a crystal ball.
And whichever way he tilts it / Know that we must be resilient
We won't let them break our spirits / As we sing our silly song.

  data/dti-520.tablet |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

 diff --git a/data/dti-520.tablet b/data/dti-520.tablet
 index 21e61d5..e2f20d7 100644
 --- a/data/dti-520.tablet
 +++ b/data/dti-520.tablet
 @@ -33,7 +33,7 @@ Ring2=false
  NumStrips=0
  # Actually 11 buttons but the two Ctrl ones send the same scancode
  Buttons=10
 -BuiltIn=false
 +BuiltIn=true

  [Buttons]
  Top=F;G;H;I;J
 --
 1.7.1


 Reviewed-by: Peter Hutterer peter.hutte...@who-t.net


 --
 Don't let slow site performance ruin your business. Deploy New Relic APM
 Deploy New Relic app performance management and know exactly
 what is happening inside your Ruby, Python, PHP, Java, and .NET app
 Try New Relic at no cost today and get our sweet Data Nerd shirt too!
 http://p.sf.net/sfu/newrelic-dev2dev
 ___
 Linuxwacom-devel mailing list
 Linuxwacom-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel