linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Alexandru Ardelean <alexandru.ardelean@analog.com>,
	Mark Brown <broonie@kernel.org>, David Jander <david@protonic.nl>,
	kernel@pengutronix.de, linux-kernel@vger.kernel.org,
	linux-input@vger.kernel.org, linux-spi@vger.kernel.org
Subject: Re: [PATCH v1] Input: touchscreen: ads7846.c: fix integer overflow on Rt calculation
Date: Tue, 17 Nov 2020 16:31:48 -0800	[thread overview]
Message-ID: <20201118003148.GE2009714@dtor-ws> (raw)
In-Reply-To: <20201113112240.1360-1-o.rempel@pengutronix.de>

On Fri, Nov 13, 2020 at 12:22:40PM +0100, Oleksij Rempel wrote:
> In some rare cases the 32 bit Rt value will overflow if z2 and x is max,
> z1 is minimal value and x_plate_ohms is relatively high (for example 800
> ohm). This would happen on some screen age with low pressure.
> 
> There are two possible fixes:
> - make Rt 64bit
> - reorder calculation to avoid overflow
> 
> The second variant seems to be preferable, since 64 bit calculation on
> 32 bit system is a bit more expensive.
> 
> Fixes: ffa458c1bd9b6f653008d450f337602f3d52a646 ("spi: ads7846 driver")
> Co-Developed-by: David Jander <david@protonic.nl>
> Signed-off-by: David Jander <david@protonic.nl>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>

Applied, thank you.

-- 
Dmitry

      reply	other threads:[~2020-11-18  0:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13 11:22 [PATCH v1] Input: touchscreen: ads7846.c: fix integer overflow on Rt calculation Oleksij Rempel
2020-11-18  0:31 ` Dmitry Torokhov [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=20201118003148.GE2009714@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=alexandru.ardelean@analog.com \
    --cc=broonie@kernel.org \
    --cc=david@protonic.nl \
    --cc=kernel@pengutronix.de \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    /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 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).