From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
To: paul@crapouillou.net
Cc: airlied@linux.ie, daniel@ffwll.ch, linux-mips@vger.kernel.org,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
Abaci Robot <abaci@linux.alibaba.com>
Subject: [PATCH] drm/ingenic: Use resource_size function on resource object
Date: Thu, 3 Mar 2022 16:08:12 +0800 [thread overview]
Message-ID: <20220303080812.27342-1-jiapeng.chong@linux.alibaba.com> (raw)
Clean up the following coccicheck warning:
./drivers/gpu/drm/ingenic/ingenic-drm-drv.c:1110:35-38: WARNING:
Suspicious code. resource_size is maybe missing with res.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
index ac52b49bf901..52ad5cab64bb 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
@@ -1107,7 +1107,7 @@ static int ingenic_drm_bind(struct device *dev, bool has_components)
}
regmap_config = ingenic_drm_regmap_config;
- regmap_config.max_register = res->end - res->start;
+ regmap_config.max_register = resource_size(res);
priv->map = devm_regmap_init_mmio(dev, base,
®map_config);
if (IS_ERR(priv->map)) {
--
2.20.1.7.g153144c
next reply other threads:[~2022-03-03 8:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-03 8:08 Jiapeng Chong [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-06-24 1:31 [PATCH] drm/ingenic: Use resource_size function on resource object Jiapeng Chong
2022-06-24 17:25 ` Sam Ravnborg
2022-06-24 19:00 ` Paul Cercueil
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=20220303080812.27342-1-jiapeng.chong@linux.alibaba.com \
--to=jiapeng.chong@linux.alibaba.com \
--cc=abaci@linux.alibaba.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=paul@crapouillou.net \
/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