commit 6b30c73e9f37183ad60c7f7050acf8e8edf91e9c introduced a read of ETP_SAMPLE_QUERY to etd->samples on line 1662. Because of that introduction, this other read of ETP_SAMPLE_QUERY at line 1040 becomes redundant and the already read etd->samples can be used instead. This line 1040 read will only be called when (etd->fw_version >> 16) == 0x14 and consequentially hardware version != 1 so the line 1662 read is also called. Signed-off-by: Ulrik De Bie <ulrik.debie-os@xxxxxxxxx> CC: Duson Lin <dusonlin@xxxxxxxxxx> --- drivers/input/mouse/elantech.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index 2955f1d..825be4b 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c @@ -1037,11 +1037,10 @@ static int elantech_set_range(struct psmouse *psmouse, fixed_dpi = param[1] & 0x10; if (((etd->fw_version >> 16) == 0x14) && fixed_dpi) { - if (etd->send_cmd(psmouse, ETP_SAMPLE_QUERY, param)) - return -1; - - *x_max = (etd->capabilities[1] - i) * param[1] / 2; - *y_max = (etd->capabilities[2] - i) * param[2] / 2; + *x_max = (etd->capabilities[1] - i) * + etd->samples[1] / 2; + *y_max = (etd->capabilities[2] - i) * + etd->samples[2] / 2; } else if (etd->fw_version == 0x040216) { *x_max = 819; *y_max = 405; -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html