Re: [Linuxwacom-devel] [PATCH] Fix prerequisite check in wcmUpdateSerial

2012-10-08 Thread Jason Gerecke
On Tue, Oct 2, 2012 at 4:35 PM, Ping Cheng  wrote:
> On Tue, Oct 2, 2012 at 2:53 PM, Jason Gerecke  wrote:
>> The prerequisite check in wcmUpdateSerial is incorrect. If the tool ID
>> changes, the property reflecting it will not be updated unless/until the
>> serial number also changes. The check is updated to reflect this.
>>
>> Additionally, the prerequesite check at one of its callsites is removed
>> since the function performs the same check internally.
>>
>> https://bugs.freedesktop.org/show_bug.cgi?id=45237
>>
>> Signed-off-by: Jason Gerecke 
>
> Nice catch! Thank you.
>
> Reviewed-by: Ping Cheng .
>
> Ping
>
>> ---
>>  src/wcmCommon.c   | 3 +--
>>  src/wcmXCommand.c | 2 +-
>>  2 files changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/wcmCommon.c b/src/wcmCommon.c
>> index cb76d5a..73bdacf 100644
>> --- a/src/wcmCommon.c
>> +++ b/src/wcmCommon.c
>> @@ -694,8 +694,7 @@ void wcmSendEvents(InputInfoPtr pInfo, const 
>> WacomDeviceState* ds)
>> return;
>> }
>>
>> -   if (priv->cur_serial != serial || priv->cur_device_id != id)
>> -   wcmUpdateSerial(pInfo, serial, id);
>> +   wcmUpdateSerial(pInfo, serial, id);
>>
>> /* don't move the cursor when going out-prox */
>> if (!ds->proximity)
>> diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c
>> index c3a2a7c..d53df08 100644
>> --- a/src/wcmXCommand.c
>> +++ b/src/wcmXCommand.c
>> @@ -925,7 +925,7 @@ wcmUpdateSerial(InputInfoPtr pInfo, unsigned int serial, 
>> int id)
>>  {
>> WacomDevicePtr priv = pInfo->private;
>>
>> -   if (priv->cur_serial == serial)
>> +   if (priv->cur_serial == serial && priv->cur_device_id == id)
>> return;
>>
>> priv->cur_serial = serial;
>> --
>> 1.7.12.2
>>
>>
>> --
>> 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

Patch merged.

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] Fix prerequisite check in wcmUpdateSerial

2012-10-02 Thread Ping Cheng
On Tue, Oct 2, 2012 at 2:53 PM, Jason Gerecke  wrote:
> The prerequisite check in wcmUpdateSerial is incorrect. If the tool ID
> changes, the property reflecting it will not be updated unless/until the
> serial number also changes. The check is updated to reflect this.
>
> Additionally, the prerequesite check at one of its callsites is removed
> since the function performs the same check internally.
>
> https://bugs.freedesktop.org/show_bug.cgi?id=45237
>
> Signed-off-by: Jason Gerecke 

Nice catch! Thank you.

Reviewed-by: Ping Cheng .

Ping

> ---
>  src/wcmCommon.c   | 3 +--
>  src/wcmXCommand.c | 2 +-
>  2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/src/wcmCommon.c b/src/wcmCommon.c
> index cb76d5a..73bdacf 100644
> --- a/src/wcmCommon.c
> +++ b/src/wcmCommon.c
> @@ -694,8 +694,7 @@ void wcmSendEvents(InputInfoPtr pInfo, const 
> WacomDeviceState* ds)
> return;
> }
>
> -   if (priv->cur_serial != serial || priv->cur_device_id != id)
> -   wcmUpdateSerial(pInfo, serial, id);
> +   wcmUpdateSerial(pInfo, serial, id);
>
> /* don't move the cursor when going out-prox */
> if (!ds->proximity)
> diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c
> index c3a2a7c..d53df08 100644
> --- a/src/wcmXCommand.c
> +++ b/src/wcmXCommand.c
> @@ -925,7 +925,7 @@ wcmUpdateSerial(InputInfoPtr pInfo, unsigned int serial, 
> int id)
>  {
> WacomDevicePtr priv = pInfo->private;
>
> -   if (priv->cur_serial == serial)
> +   if (priv->cur_serial == serial && priv->cur_device_id == id)
> return;
>
> priv->cur_serial = serial;
> --
> 1.7.12.2
>
>
> --
> 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


[Linuxwacom-devel] [PATCH] Fix prerequisite check in wcmUpdateSerial

2012-10-02 Thread Jason Gerecke
The prerequisite check in wcmUpdateSerial is incorrect. If the tool ID
changes, the property reflecting it will not be updated unless/until the
serial number also changes. The check is updated to reflect this.

Additionally, the prerequesite check at one of its callsites is removed
since the function performs the same check internally.

https://bugs.freedesktop.org/show_bug.cgi?id=45237

Signed-off-by: Jason Gerecke 
---
 src/wcmCommon.c   | 3 +--
 src/wcmXCommand.c | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/wcmCommon.c b/src/wcmCommon.c
index cb76d5a..73bdacf 100644
--- a/src/wcmCommon.c
+++ b/src/wcmCommon.c
@@ -694,8 +694,7 @@ void wcmSendEvents(InputInfoPtr pInfo, const 
WacomDeviceState* ds)
return;
}
 
-   if (priv->cur_serial != serial || priv->cur_device_id != id)
-   wcmUpdateSerial(pInfo, serial, id);
+   wcmUpdateSerial(pInfo, serial, id);
 
/* don't move the cursor when going out-prox */
if (!ds->proximity)
diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c
index c3a2a7c..d53df08 100644
--- a/src/wcmXCommand.c
+++ b/src/wcmXCommand.c
@@ -925,7 +925,7 @@ wcmUpdateSerial(InputInfoPtr pInfo, unsigned int serial, 
int id)
 {
WacomDevicePtr priv = pInfo->private;
 
-   if (priv->cur_serial == serial)
+   if (priv->cur_serial == serial && priv->cur_device_id == id)
return;
 
priv->cur_serial = serial;
-- 
1.7.12.2


--
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