From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: "Ronald Tschalär" <ronald@innovation.ch>
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 v2] Input: applespi: fix warnings detected by sparse
Date: Sun, 21 Jul 2019 15:27:54 +0300 [thread overview]
Message-ID: <20190721122754.GA757@penguin> (raw)
In-Reply-To: <20190721081040.26197-1-ronald@innovation.ch>
On Sun, Jul 21, 2019 at 01:10:40AM -0700, Ronald Tschalär wrote:
> Reported-by: kbuild test robot <lkp@intel.com>
> Signed-off-by: Ronald Tschalär <ronald@innovation.ch>
Applied, thank you.
> ---
> Changes in v2:
> replaced min_t/max_t with plain min/max since both arguments are now
> int's and don't need further casting
>
> 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..cd140a92e731 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);
> - applespi->tp_dim_max_x = max_t(int, applespi->tp_dim_max_x, f->abs_x);
> - applespi->tp_dim_min_y = min_t(int, applespi->tp_dim_min_y, f->abs_y);
> - applespi->tp_dim_max_y = max_t(int, applespi->tp_dim_max_y, f->abs_y);
> + applespi->tp_dim_min_x = min(applespi->tp_dim_min_x,
> + le16_to_int(f->abs_x));
> + applespi->tp_dim_max_x = max(applespi->tp_dim_max_x,
> + le16_to_int(f->abs_x));
> + applespi->tp_dim_min_y = min(applespi->tp_dim_min_y,
> + le16_to_int(f->abs_y));
> + applespi->tp_dim_max_y = max(applespi->tp_dim_max_y,
> + le16_to_int(f->abs_y));
> }
>
> static int applespi_tp_dim_open(struct inode *inode, struct file *file)
> @@ -1653,8 +1657,8 @@ static void applespi_save_bl_level(struct applespi_data *applespi,
> efi_attr = EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS |
> EFI_VARIABLE_RUNTIME_ACCESS;
>
> - sts = efivar_entry_set_safe(EFI_BL_LEVEL_NAME, efi_guid, efi_attr, true,
> - efi_data_len, &efi_data);
> + sts = efivar_entry_set_safe((efi_char16_t *)EFI_BL_LEVEL_NAME, efi_guid,
> + efi_attr, true, efi_data_len, &efi_data);
> if (sts)
> dev_warn(&applespi->spi->dev,
> "Error saving backlight level to EFI vars: %d\n", sts);
> @@ -2027,7 +2031,7 @@ static const struct acpi_device_id applespi_acpi_match[] = {
> };
> MODULE_DEVICE_TABLE(acpi, applespi_acpi_match);
>
> -const struct dev_pm_ops applespi_pm_ops = {
> +static const struct dev_pm_ops applespi_pm_ops = {
> SET_SYSTEM_SLEEP_PM_OPS(applespi_suspend, applespi_resume)
> .poweroff_late = applespi_poweroff_late,
> };
> --
> 2.21.0
>
--
Dmitry
prev parent reply other threads:[~2019-07-21 12:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-21 8:10 [PATCH v2] Input: applespi: fix warnings detected by sparse Ronald Tschalär
2019-07-21 12:27 ` 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=20190721122754.GA757@penguin \
--to=dmitry.torokhov@gmail.com \
--cc=federico@travelground.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=ronald@innovation.ch \
/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.