Skip to content

Commit

Permalink
drm/i915/gvt: fix sparse warnings on different address spaces
Browse files Browse the repository at this point in the history
Add proper __iomem annotation for pointers obtained via ioremap().

Signed-off-by: Du, Changbin <changbin.du@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
  • Loading branch information
Du, Changbin authored and Zhenyu Wang committed Oct 20, 2016
1 parent 0fac21e commit 321927d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions drivers/gpu/drm/i915/gvt/firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct gvt_firmware_header {
#define RD(offset) (readl(mmio + offset.reg))
#define WR(v, offset) (writel(v, mmio + offset.reg))

static void bdw_forcewake_get(void *mmio)
static void bdw_forcewake_get(void __iomem *mmio)
{
WR(_MASKED_BIT_DISABLE(0xffff), FORCEWAKE_MT);

Expand Down Expand Up @@ -91,7 +91,8 @@ static struct bin_attribute firmware_attr = {
.mmap = NULL,
};

static int expose_firmware_sysfs(struct intel_gvt *gvt, void *mmio)
static int expose_firmware_sysfs(struct intel_gvt *gvt,
void __iomem *mmio)
{
struct intel_gvt_device_info *info = &gvt->device_info;
struct pci_dev *pdev = gvt->dev_priv->drm.pdev;
Expand Down Expand Up @@ -234,7 +235,8 @@ int intel_gvt_load_firmware(struct intel_gvt *gvt)
struct gvt_firmware_header *h;
const struct firmware *fw;
char *path;
void *mmio, *mem;
void __iomem *mmio;
void *mem;
int ret;

path = kmalloc(PATH_MAX, GFP_KERNEL);
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/i915/gvt/gtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ static inline int get_pse_type(int type)

static u64 read_pte64(struct drm_i915_private *dev_priv, unsigned long index)
{
void *addr = (u64 *)dev_priv->ggtt.gsm + index;
void __iomem *addr = (gen8_pte_t __iomem *)dev_priv->ggtt.gsm + index;
u64 pte;

#ifdef readq
Expand All @@ -284,7 +284,7 @@ static u64 read_pte64(struct drm_i915_private *dev_priv, unsigned long index)
static void write_pte64(struct drm_i915_private *dev_priv,
unsigned long index, u64 pte)
{
void *addr = (u64 *)dev_priv->ggtt.gsm + index;
void __iomem *addr = (gen8_pte_t __iomem *)dev_priv->ggtt.gsm + index;

#ifdef writeq
writeq(pte, addr);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/gvt/gvt.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ struct intel_gvt_firmware {
};

struct intel_gvt_opregion {
void *opregion_va;
void __iomem *opregion_va;
u32 opregion_pa;
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/gvt/opregion.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

static int init_vgpu_opregion(struct intel_vgpu *vgpu, u32 gpa)
{
void *host_va = vgpu->gvt->opregion.opregion_va;
void __iomem *host_va = vgpu->gvt->opregion.opregion_va;
u8 *buf;
int i;

Expand Down

0 comments on commit 321927d

Please sign in to comment.