From: David Laight <David.Laight@ACULAB.COM>
To: "'Rafael J. Wysocki'" <rafael@kernel.org>,
Zhang Rui <rui.zhang@intel.com>
Cc: "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"rafael.j.wysocki@intel.com" <rafael.j.wysocki@intel.com>,
"daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"lkp@intel.com" <lkp@intel.com>
Subject: RE: [PATCH] powercap: intel_rapl_tpmi: Fix a sparse warning
Date: Fri, 14 Jul 2023 13:33:57 +0000 [thread overview]
Message-ID: <a6d032df2b664950a63518c83a7db3f3@AcuMS.aculab.com> (raw)
In-Reply-To: <CAJZ5v0gZz1RCqp=Do0RTOCwPvWW9E_SQSyFjuRVuBkR9jxCJjw@mail.gmail.com>
From: Rafael J. Wysocki
> Sent: 11 July 2023 19:14
...
> On Tue, Jul 4, 2023 at 7:02 AM Zhang Rui <rui.zhang@intel.com> wrote:
> >
> > Fix a sparse warning in intel_rapl_tpmi driver.
> >
> > ../drivers/powercap/intel_rapl_tpmi.c:141:41: sparse: warning: incorrect type in initializer
> (different address spaces)
> > ../drivers/powercap/intel_rapl_tpmi.c:141:41: sparse: expected unsigned long long [usertype]
> *tpmi_rapl_regs
> > ../drivers/powercap/intel_rapl_tpmi.c:141:41: sparse: got void [noderef] __iomem *
> >
> > Fixes: 9eef7f9da928 ("powercap: intel_rapl: Introduce RAPL TPMI interface driver")
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202307031405.dy3druuy-lkp@intel.com/
> > Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> > ---
> > drivers/powercap/intel_rapl_tpmi.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/powercap/intel_rapl_tpmi.c b/drivers/powercap/intel_rapl_tpmi.c
> > index 4f4f13ded225..05f664a096ab 100644
> > --- a/drivers/powercap/intel_rapl_tpmi.c
> > +++ b/drivers/powercap/intel_rapl_tpmi.c
> > @@ -138,7 +138,7 @@ static int parse_one_domain(struct tpmi_rapl_package *trp, u32 offset)
> > enum tpmi_rapl_register reg_index;
> > enum rapl_domain_reg_id reg_id;
> > int tpmi_domain_size, tpmi_domain_flags;
> > - u64 *tpmi_rapl_regs = trp->base + offset;
> > + u64 *tpmi_rapl_regs = (u64 *)(trp->base + offset);
> > u64 tpmi_domain_header = readq((void __iomem *)tpmi_rapl_regs);
Isn't the correct fix to add __iomem to the definition of
tpmi_rapi_regs and also remove the cast from the following
readq() line?
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2023-07-14 13:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-04 5:02 Zhang Rui
2023-07-11 18:14 ` Rafael J. Wysocki
2023-07-14 13:33 ` David Laight [this message]
2023-07-14 14:39 ` Rafael J. Wysocki
2023-07-17 9:13 ` Zhang, Rui
2023-07-17 9:31 ` David Laight
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=a6d032df2b664950a63518c83a7db3f3@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lkp@intel.com \
--cc=rafael.j.wysocki@intel.com \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®