Linux Input/HID development
 help / color / mirror / Atom feed
From: "Life is hard, and then you die" <ronald@innovation.ch>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Federico Lorenzi <federico@travelground.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	kbuild test robot <lkp@intel.com>
Subject: Re: [PATCH 2/2] Input: applespi: fix warnings detected by sparse
Date: Sun, 21 Jul 2019 00:59:18 -0700	[thread overview]
Message-ID: <20190721075918.GC7992@innovation.ch> (raw)
In-Reply-To: <20190721072427.GB607@penguin>


  Hi Dmitry,

On Sun, Jul 21, 2019 at 10:24:27AM +0300, Dmitry Torokhov wrote:
> On Sun, Jul 21, 2019 at 12:06:29AM -0700, Ronald Tschalär wrote:
> > Reported-by: kbuild test robot <lkp@intel.com>
> > Signed-off-by: Ronald Tschalär <ronald@innovation.ch>
> > ---
> >  drivers/input/keyboard/applespi.c | 18 +++++++++++-------
> >  1 file changed, 11 insertions(+), 7 deletions(-)
> > 
> > diff --git a/drivers/input/keyboard/applespi.c b/drivers/input/keyboard/applespi.c
> > index d5defdefbc34..00cd8dccd4f5 100644
> > --- a/drivers/input/keyboard/applespi.c
> > +++ b/drivers/input/keyboard/applespi.c
> > @@ -998,10 +998,14 @@ static inline int le16_to_int(__le16 x)
> >  static void applespi_debug_update_dimensions(struct applespi_data *applespi,
> >  					     const struct tp_finger *f)
> >  {
> > -	applespi->tp_dim_min_x = min_t(int, applespi->tp_dim_min_x, f->abs_x);
> 
> Should we also make tp_dim_* u16? Then we won't need min_t here.

abs_x/abs_y are actually signed values and sometimes negative, and
hence tp_dim_min_* are negative here. But we can just replace the
min_t/max_t with min/max, since both args are now int's.


  Cheers,

  Ronald

      reply	other threads:[~2019-07-21  7:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-21  7:06 [PATCH 2/2] Input: applespi: fix warnings detected by sparse Ronald Tschalär
2019-07-21  7:24 ` Dmitry Torokhov
2019-07-21  7:59   ` Life is hard, and then you die [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=20190721075918.GC7992@innovation.ch \
    --to=ronald@innovation.ch \
    --cc=dmitry.torokhov@gmail.com \
    --cc=federico@travelground.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    /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