Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [Intel-gfx] [PATCH 2/4] drm/i915/uncore: cast iomem to avoid sparse warning
Date: Tue,  7 Feb 2023 14:40:24 +0200	[thread overview]
Message-ID: <20230207124026.2105442-2-jani.nikula@intel.com> (raw)
In-Reply-To: <20230207124026.2105442-1-jani.nikula@intel.com>

drmm_add_action_or_reset() is unaware of __iomem and the pointer needs
to be a plain void *. Cast __iomem away and back while the pointer goes
through drmm.

drivers/gpu/drm/i915/intel_uncore.c:2463:17: warning: incorrect type in argument 1 (different address spaces)
drivers/gpu/drm/i915/intel_uncore.c:2463:17:    expected void volatile [noderef] __iomem *addr
drivers/gpu/drm/i915/intel_uncore.c:2463:17:    got void *regs
drivers/gpu/drm/i915/intel_uncore.c:2494:16: warning: incorrect type in argument 3 (different address spaces)
drivers/gpu/drm/i915/intel_uncore.c:2494:16:    expected void *data
drivers/gpu/drm/i915/intel_uncore.c:2494:16:    got void [noderef] __iomem *regs

Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_uncore.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 8dee9e62a73e..f018da7ebaac 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -2460,7 +2460,7 @@ static int i915_pmic_bus_access_notifier(struct notifier_block *nb,
 
 static void uncore_unmap_mmio(struct drm_device *drm, void *regs)
 {
-	iounmap(regs);
+	iounmap((void __iomem *)regs);
 }
 
 int intel_uncore_setup_mmio(struct intel_uncore *uncore, phys_addr_t phys_addr)
@@ -2491,7 +2491,8 @@ int intel_uncore_setup_mmio(struct intel_uncore *uncore, phys_addr_t phys_addr)
 		return -EIO;
 	}
 
-	return drmm_add_action_or_reset(&i915->drm, uncore_unmap_mmio, uncore->regs);
+	return drmm_add_action_or_reset(&i915->drm, uncore_unmap_mmio,
+					(void __force *)uncore->regs);
 }
 
 void intel_uncore_init_early(struct intel_uncore *uncore,
-- 
2.34.1


  reply	other threads:[~2023-02-07 12:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07 12:40 [Intel-gfx] [PATCH 1/4] drm/i915/gt: add sparse lock annotation to avoid warnings Jani Nikula
2023-02-07 12:40 ` Jani Nikula [this message]
2023-02-07 19:05   ` [Intel-gfx] [PATCH 2/4] drm/i915/uncore: cast iomem to avoid sparse warning Matt Roper
2023-02-07 12:40 ` [Intel-gfx] [PATCH 3/4] drm/i915/syncmap: squelch a " Jani Nikula
2023-02-07 12:40 ` [Intel-gfx] [PATCH 4/4] drm/i915/pxp: fix __le64 access to get rid of " Jani Nikula
2023-02-07 12:44   ` Winkler, Tomas
2023-02-07 13:21 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/4] drm/i915/gt: add sparse lock annotation to avoid warnings Patchwork
2023-02-07 13:53 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-02-07 15:20 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/4] drm/i915/gt: add sparse lock annotation to avoid warnings (rev2) Patchwork
2023-02-07 15:34 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-02-07 18:13 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-02-07 19:03 ` [Intel-gfx] [PATCH 1/4] drm/i915/gt: add sparse lock annotation to avoid warnings Matt Roper

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=20230207124026.2105442-2-jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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