From: Wang Qing Date: Tue, 14 Dec 2021 12:18:36 +0000 (-0800) Subject: platform/x86: apple-gmux: use resource_size() with res X-Git-Tag: v6.6.17~8471^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=855045873b54b9f8dd71a0468db9ff52aa27444f;p=platform%2Fkernel%2Flinux-rpi.git platform/x86: apple-gmux: use resource_size() with res This should be (res->end - res->start + 1) here actually, use resource_size() derectly. Signed-off-by: Wang Qing Link: https://lore.kernel.org/r/1639484316-75873-1-git-send-email-wangqing@vivo.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede --- diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c index 9aae45a..57553f9 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",