[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <201703101946.40504@pali>
Date: Fri, 10 Mar 2017 19:46:40 +0100
From: Pali Rohár <pali.rohar@...il.com>
To: Masaki Ota <012nexus@...il.com>
Cc: dmitry.torokhov@...il.com, linux-kernel@...lsd.com,
nick.m.fletcher@...il.com, joseph.salisbury@...onical.com,
ben@...rt-cactus.org, mhocko@...e.com, rydberg@...math.org,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
masaki.ota@...alps.com
Subject: Re: [PATCH] Fix V8 device information issue
Hi! I have just two notes:
On Friday 10 March 2017 07:41:47 Masaki Ota wrote:
...
> + x_phys = x_pitch * (num_x_electrode - 1); /* In 0.1 mm units */
> + y_phys = y_pitch * (num_y_electrode - 1); /* In 0.1 mm units */
...
> + priv->x_res = priv->x_max * 10 / x_phys; /* units / mm */
> + priv->y_res = priv->y_max * 10 / y_phys; /* units / mm */
> +
> + } else {
...
> + x_phys = x_pitch * (num_x_electrode - 1); /* In 0.1 mm units */
> + y_phys = y_pitch * (num_y_electrode - 1); /* In 0.1 mm units */
> +
> + priv->x_res = priv->x_max * 10 / x_phys; /* units / mm */
> + priv->y_res = priv->y_max * 10 / y_phys; /* units / mm */
Looks like above 4 lines are same in both if { } and else { } blocks.
So it can be moved outside of if blocks.
> + }
> return 0;
> }
>
> @@ -2490,7 +2515,10 @@ static int alps_update_btn_info_ss4_v2(unsigned char otp[][4],
> {
> unsigned char is_btnless;
>
> - is_btnless = (otp[1][1] >> 3) & 0x01;
> + if (priv->dev_id[2] == 0x28)
This check "dev_id[2] == 0x28" is used on more places. What about
introducing some flag or some boolean macro? Check "dev_id[2] == 0x28"
is magical does not say anything what it is doing...
--
Pali Rohár
pali.rohar@...il.com
Download attachment "signature.asc " of type "application/pgp-signature" (199 bytes)
Powered by blists - more mailing lists