All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Wang Qing <wangqing@vivo.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Sasha Levin <sashal@kernel.org>,
	markgross@kernel.org, platform-driver-x86@vger.kernel.org
Subject: [PATCH AUTOSEL 5.4 8/9] platform/x86: apple-gmux: use resource_size() with res
Date: Mon, 27 Dec 2021 14:05:35 -0500	[thread overview]
Message-ID: <20211227190536.1042975-8-sashal@kernel.org> (raw)
In-Reply-To: <20211227190536.1042975-1-sashal@kernel.org>

From: Wang Qing <wangqing@vivo.com>

[ Upstream commit eb66fb03a727cde0ab9b1a3858de55c26f3007da ]

This should be (res->end - res->start + 1) here actually,
use resource_size() derectly.

Signed-off-by: Wang Qing <wangqing@vivo.com>
Link: https://lore.kernel.org/r/1639484316-75873-1-git-send-email-wangqing@vivo.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/platform/x86/apple-gmux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c
index 7e3083deb1c5d..1b86005c0f5f4 100644
--- a/drivers/platform/x86/apple-gmux.c
+++ b/drivers/platform/x86/apple-gmux.c
@@ -625,7 +625,7 @@ static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id)
 	}
 
 	gmux_data->iostart = res->start;
-	gmux_data->iolen = res->end - res->start;
+	gmux_data->iolen = resource_size(res);
 
 	if (gmux_data->iolen < GMUX_MIN_IO_LEN) {
 		pr_err("gmux I/O region too small (%lu < %u)\n",
-- 
2.34.1


  parent reply	other threads:[~2021-12-27 19:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-27 19:05 [PATCH AUTOSEL 5.4 1/9] pinctrl: mediatek: fix global-out-of-bounds issue Sasha Levin
2021-12-27 19:05 ` Sasha Levin
2021-12-27 19:05 ` Sasha Levin
2021-12-27 19:05 ` [PATCH AUTOSEL 5.4 2/9] Input: i8042 - add deferred probe support Sasha Levin
2021-12-27 19:05 ` [PATCH AUTOSEL 5.4 3/9] Input: i8042 - enable deferred probe quirk for ASUS UM325UA Sasha Levin
2021-12-27 19:05 ` [PATCH AUTOSEL 5.4 4/9] hwmon: (lm90) Do not report 'busy' status bit as alarm Sasha Levin
2021-12-27 19:05 ` [PATCH AUTOSEL 5.4 5/9] tomoyo: Check exceeded quota early in tomoyo_domain_quota_is_ok() Sasha Levin
2021-12-27 19:05 ` [PATCH AUTOSEL 5.4 6/9] ax25: NPD bug when detaching AX25 device Sasha Levin
2021-12-27 19:05 ` [PATCH AUTOSEL 5.4 7/9] phonet/pep: refuse to enable an unbound pipe Sasha Levin
2021-12-27 19:05 ` Sasha Levin [this message]
2021-12-27 19:05 ` [PATCH AUTOSEL 5.4 9/9] memblock: fix memblock_phys_alloc() section mismatch error Sasha Levin

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=20211227190536.1042975-8-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markgross@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=wangqing@vivo.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 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.