From: "Pali Rohár" <pali.rohar@gmail.com>
To: Masaki Ota <012nexus@gmail.com>
Cc: dmitry.torokhov@gmail.com, linux-kernel@paulsd.com,
nick.m.fletcher@gmail.com, joseph.salisbury@canonical.com,
ben@smart-cactus.org, mhocko@suse.com, rydberg@bitmath.org,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
masaki.ota@jp.alps.com
Subject: Re: [PATCH] Fix V8 device information issue
Date: Fri, 10 Mar 2017 19:46:40 +0100 [thread overview]
Message-ID: <201703101946.40504@pali> (raw)
In-Reply-To: <20170310064147.10992-1-masaki.ota@jp.alps.com>
[-- Attachment #1: Type: Text/Plain, Size: 1252 bytes --]
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@gmail.com
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
prev parent reply other threads:[~2017-03-10 18:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-10 6:41 [PATCH] Fix V8 device information issue Masaki Ota
2017-03-10 18:46 ` Pali Rohár [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201703101946.40504@pali \
--to=pali.rohar@gmail.com \
--cc=012nexus@gmail.com \
--cc=ben@smart-cactus.org \
--cc=dmitry.torokhov@gmail.com \
--cc=joseph.salisbury@canonical.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@paulsd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masaki.ota@jp.alps.com \
--cc=mhocko@suse.com \
--cc=nick.m.fletcher@gmail.com \
--cc=rydberg@bitmath.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.