Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9345CC433FE for ; Mon, 3 Jan 2022 14:21:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233283AbiACOVl (ORCPT ); Mon, 3 Jan 2022 09:21:41 -0500 Received: from sin.source.kernel.org ([145.40.73.55]:45228 "EHLO sin.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233268AbiACOVg (ORCPT ); Mon, 3 Jan 2022 09:21:36 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id C0ED9CE1105; Mon, 3 Jan 2022 14:21:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64E8EC36AEB; Mon, 3 Jan 2022 14:21:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1641219686; bh=JSBB6I1iNycnOk23h6lCNT9O5YTlSrtEZ6D1iPq7PJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pBX8FWjWdlm57+W3ysRooncxufYAa0Eu/nD4l3r6ibiGu1RHSnRvsVtUrWY2tZGBm E1emxQiEiGMzMWjv7ujvFDS3E7ITYQBWHhSF78xuZgzdqTdykBDZ0tNQRNDy20Rfzp kfMlB5XLwimUH1989dzhd8ASce27hekxqU9/g27U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wang Qing , Hans de Goede , Sasha Levin Subject: [PATCH 4.4 01/11] platform/x86: apple-gmux: use resource_size() with res Date: Mon, 3 Jan 2022 15:21:12 +0100 Message-Id: <20220103142050.820872836@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220103142050.763904028@linuxfoundation.org> References: <20220103142050.763904028@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wang Qing [ Upstream commit eb66fb03a727cde0ab9b1a3858de55c26f3007da ] 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 Signed-off-by: Sasha Levin --- 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 976efeb3f2ba3..a0f10ccdca3e4 100644 --- a/drivers/platform/x86/apple-gmux.c +++ b/drivers/platform/x86/apple-gmux.c @@ -461,7 +461,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