* [PATCH] Input: cyapa: remove variable overwriting
@ 2015-09-15 10:06 Sudip Mukherjee
2015-09-28 22:43 ` Dmitry Torokhov
0 siblings, 1 reply; 4+ messages in thread
From: Sudip Mukherjee @ 2015-09-15 10:06 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-kernel, linux-input, Sudip Mukherjee
Even if rotat_align is true or false the final value of
cyapa->electrodes_rx is always cyapa->electrodes_y. remove the variable
overwriting and in the process remove the variable rotat_align which is
not required any more.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/input/mouse/cyapa_gen6.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/input/mouse/cyapa_gen6.c b/drivers/input/mouse/cyapa_gen6.c
index 5f19107..f0c614b 100644
--- a/drivers/input/mouse/cyapa_gen6.c
+++ b/drivers/input/mouse/cyapa_gen6.c
@@ -196,7 +196,6 @@ static int cyapa_gen6_read_sys_info(struct cyapa *cyapa)
u8 resp_data[PIP_READ_SYS_INFO_RESP_LENGTH];
int resp_len;
u16 product_family;
- u8 rotat_align;
int error;
/* Get App System Information to determine Gen5 or Gen6. */
@@ -241,14 +240,7 @@ static int cyapa_gen6_read_sys_info(struct cyapa *cyapa)
memcpy(&cyapa->product_id[13], &resp_data[62], 2);
cyapa->product_id[15] = '\0';
- rotat_align = resp_data[68];
- if (rotat_align) {
- cyapa->electrodes_rx = cyapa->electrodes_y;
- cyapa->electrodes_rx = cyapa->electrodes_y;
- } else {
- cyapa->electrodes_rx = cyapa->electrodes_x;
- cyapa->electrodes_rx = cyapa->electrodes_y;
- }
+ cyapa->electrodes_rx = cyapa->electrodes_y;
cyapa->aligned_electrodes_rx = (cyapa->electrodes_rx + 3) & ~3u;
if (!cyapa->electrodes_x || !cyapa->electrodes_y ||
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Input: cyapa: remove variable overwriting
2015-09-15 10:06 [PATCH] Input: cyapa: remove variable overwriting Sudip Mukherjee
@ 2015-09-28 22:43 ` Dmitry Torokhov
2015-09-29 6:48 ` Sudip Mukherjee
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2015-09-28 22:43 UTC (permalink / raw)
To: Sudip Mukherjee, Dudley Du; +Cc: lkml, linux-input@vger.kernel.org
Hi Sudip,
On Tue, Sep 15, 2015 at 3:06 AM, Sudip Mukherjee
<sudipm.mukherjee@gmail.com> wrote:
> Even if rotat_align is true or false the final value of
> cyapa->electrodes_rx is always cyapa->electrodes_y. remove the variable
> overwriting and in the process remove the variable rotat_align which is
> not required any more.
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
> drivers/input/mouse/cyapa_gen6.c | 10 +---------
> 1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/drivers/input/mouse/cyapa_gen6.c b/drivers/input/mouse/cyapa_gen6.c
> index 5f19107..f0c614b 100644
> --- a/drivers/input/mouse/cyapa_gen6.c
> +++ b/drivers/input/mouse/cyapa_gen6.c
> @@ -196,7 +196,6 @@ static int cyapa_gen6_read_sys_info(struct cyapa *cyapa)
> u8 resp_data[PIP_READ_SYS_INFO_RESP_LENGTH];
> int resp_len;
> u16 product_family;
> - u8 rotat_align;
> int error;
>
> /* Get App System Information to determine Gen5 or Gen6. */
> @@ -241,14 +240,7 @@ static int cyapa_gen6_read_sys_info(struct cyapa *cyapa)
> memcpy(&cyapa->product_id[13], &resp_data[62], 2);
> cyapa->product_id[15] = '\0';
>
> - rotat_align = resp_data[68];
> - if (rotat_align) {
> - cyapa->electrodes_rx = cyapa->electrodes_y;
> - cyapa->electrodes_rx = cyapa->electrodes_y;
> - } else {
> - cyapa->electrodes_rx = cyapa->electrodes_x;
> - cyapa->electrodes_rx = cyapa->electrodes_y;
> - }
> + cyapa->electrodes_rx = cyapa->electrodes_y;
II think it was probably a typo rather than rotat_align being not
needed. Dudley?
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Input: cyapa: remove variable overwriting
2015-09-28 22:43 ` Dmitry Torokhov
@ 2015-09-29 6:48 ` Sudip Mukherjee
2015-10-12 2:20 ` Dudley Du
0 siblings, 1 reply; 4+ messages in thread
From: Sudip Mukherjee @ 2015-09-29 6:48 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: Dudley Du, lkml, linux-input@vger.kernel.org
On Mon, Sep 28, 2015 at 03:43:04PM -0700, Dmitry Torokhov wrote:
> Hi Sudip,
>
> On Tue, Sep 15, 2015 at 3:06 AM, Sudip Mukherjee
> <sudipm.mukherjee@gmail.com> wrote:
> > Even if rotat_align is true or false the final value of
> > cyapa->electrodes_rx is always cyapa->electrodes_y. remove the variable
> > overwriting and in the process remove the variable rotat_align which is
> > not required any more.
> >
> > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> > ---
> > drivers/input/mouse/cyapa_gen6.c | 10 +---------
> > 1 file changed, 1 insertion(+), 9 deletions(-)
> >
> > diff --git a/drivers/input/mouse/cyapa_gen6.c b/drivers/input/mouse/cyapa_gen6.c
> > index 5f19107..f0c614b 100644
> > --- a/drivers/input/mouse/cyapa_gen6.c
> > +++ b/drivers/input/mouse/cyapa_gen6.c
> > @@ -196,7 +196,6 @@ static int cyapa_gen6_read_sys_info(struct cyapa *cyapa)
> > u8 resp_data[PIP_READ_SYS_INFO_RESP_LENGTH];
> > int resp_len;
> > u16 product_family;
> > - u8 rotat_align;
> > int error;
> >
> > /* Get App System Information to determine Gen5 or Gen6. */
> > @@ -241,14 +240,7 @@ static int cyapa_gen6_read_sys_info(struct cyapa *cyapa)
> > memcpy(&cyapa->product_id[13], &resp_data[62], 2);
> > cyapa->product_id[15] = '\0';
> >
> > - rotat_align = resp_data[68];
> > - if (rotat_align) {
> > - cyapa->electrodes_rx = cyapa->electrodes_y;
> > - cyapa->electrodes_rx = cyapa->electrodes_y;
> > - } else {
> > - cyapa->electrodes_rx = cyapa->electrodes_x;
> > - cyapa->electrodes_rx = cyapa->electrodes_y;
> > - }
> > + cyapa->electrodes_rx = cyapa->electrodes_y;
>
> II think it was probably a typo rather than rotat_align being not
> needed. Dudley?
maybe some copy paste error. I thought it might have been
cyapa->electrodes_ry but there is nothing like that.
regards
sudip
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] Input: cyapa: remove variable overwriting
2015-09-29 6:48 ` Sudip Mukherjee
@ 2015-10-12 2:20 ` Dudley Du
0 siblings, 0 replies; 4+ messages in thread
From: Dudley Du @ 2015-10-12 2:20 UTC (permalink / raw)
To: Sudip Mukherjee, Dmitry Torokhov; +Cc: lkml, linux-input@vger.kernel.org
> -----Original Message-----
> From: Sudip Mukherjee [mailto:sudipm.mukherjee@gmail.com]
> Sent: 2015?9?29? 14:48
> To: Dmitry Torokhov
> Cc: Dudley Du; lkml; linux-input@vger.kernel.org
> Subject: Re: [PATCH] Input: cyapa: remove variable overwriting
>
> On Mon, Sep 28, 2015 at 03:43:04PM -0700, Dmitry Torokhov wrote:
> > Hi Sudip,
> >
> > On Tue, Sep 15, 2015 at 3:06 AM, Sudip Mukherjee
> > <sudipm.mukherjee@gmail.com> wrote:
> > > Even if rotat_align is true or false the final value of
> > > cyapa->electrodes_rx is always cyapa->electrodes_y. remove the variable
> > > overwriting and in the process remove the variable rotat_align which is
> > > not required any more.
> > >
> > > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> > > ---
> > > drivers/input/mouse/cyapa_gen6.c | 10 +---------
> > > 1 file changed, 1 insertion(+), 9 deletions(-)
> > >
> > > diff --git a/drivers/input/mouse/cyapa_gen6.c
> b/drivers/input/mouse/cyapa_gen6.c
> > > index 5f19107..f0c614b 100644
> > > --- a/drivers/input/mouse/cyapa_gen6.c
> > > +++ b/drivers/input/mouse/cyapa_gen6.c
> > > @@ -196,7 +196,6 @@ static int cyapa_gen6_read_sys_info(struct cyapa
> *cyapa)
> > > u8 resp_data[PIP_READ_SYS_INFO_RESP_LENGTH];
> > > int resp_len;
> > > u16 product_family;
> > > - u8 rotat_align;
> > > int error;
> > >
> > > /* Get App System Information to determine Gen5 or Gen6. */
> > > @@ -241,14 +240,7 @@ static int cyapa_gen6_read_sys_info(struct cyapa
> *cyapa)
> > > memcpy(&cyapa->product_id[13], &resp_data[62], 2);
> > > cyapa->product_id[15] = '\0';
> > >
> > > - rotat_align = resp_data[68];
> > > - if (rotat_align) {
> > > - cyapa->electrodes_rx = cyapa->electrodes_y;
> > > - cyapa->electrodes_rx = cyapa->electrodes_y;
> > > - } else {
> > > - cyapa->electrodes_rx = cyapa->electrodes_x;
> > > - cyapa->electrodes_rx = cyapa->electrodes_y;
> > > - }
> > > + cyapa->electrodes_rx = cyapa->electrodes_y;
> >
> > II think it was probably a typo rather than rotat_align being not
> > needed. Dudley?
> maybe some copy paste error. I thought it might have been
> cyapa->electrodes_ry but there is nothing like that.
Thanks for the correction. It should be my copy issue.
The variable cyapa->electrodes_rx was used to store the real physical Rx electrode direction.
Because the Rx direction in the signal data map may direction for the physical Rx electrode direction.
so it must be rotated when read and use the signal data map data.
This variable was currently used in for read the baseline of the Gen5 trackpad device.
And also it was used by the application to help display the real signal map on the trackpad device.
Following is the correction of this code, I will submit the patch to fix this thanks.
-if (rotat_align) {
+if (rotat_align)
cyapa->electrodes_rx = cyapa->electrodes_y;
-cyapa->electrodes_rx = cyapa->electrodes_y;
- } else {
+else
cyapa->electrodes_rx = cyapa->electrodes_x;
-cyapa->electrodes_rx = cyapa->electrodes_y;
- }
>
> regards
> sudip
This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-10-12 2:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-15 10:06 [PATCH] Input: cyapa: remove variable overwriting Sudip Mukherjee
2015-09-28 22:43 ` Dmitry Torokhov
2015-09-29 6:48 ` Sudip Mukherjee
2015-10-12 2:20 ` Dudley Du
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).