Message ID | 20211112132456.19800-1-siva.mullati@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/i915: Skip remap_io_mapping() for non-x86 platforms | expand |
On Fri, 12 Nov 2021, Mullati Siva <siva.mullati@intel.com> wrote: > From: "Mullati, Siva" <siva.mullati@intel.com> > > The _PAGE_CACHE_MASK macro is not defined in non-x86 > architectures and it's been used in remap_io_mapping(). > Only hw that supports mappable aperture would hit this path > remap_io_mapping(), So skip this code for non-x86 architectures. > > Signed-off-by: Mullati, Siva <siva.mullati@intel.com> > --- > drivers/gpu/drm/i915/i915_mm.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c > index 666808cb3a32..5e2a1868b957 100644 > --- a/drivers/gpu/drm/i915/i915_mm.c > +++ b/drivers/gpu/drm/i915/i915_mm.c > @@ -91,6 +91,7 @@ int remap_io_mapping(struct vm_area_struct *vma, > unsigned long addr, unsigned long pfn, unsigned long size, > struct io_mapping *iomap) > { > +#if defined(CONFIG_X86) Please don't add conditional compilation within functions. Please use #if IS_ENABLED() instead of #if defined or #ifdef. BR, Jani. > struct remap_pfn r; > int err; > > @@ -108,6 +109,7 @@ int remap_io_mapping(struct vm_area_struct *vma, > zap_vma_ptes(vma, addr, (r.pfn - pfn) << PAGE_SHIFT); > return err; > } > +#endif > > return 0; > }
diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c index 666808cb3a32..5e2a1868b957 100644 --- a/drivers/gpu/drm/i915/i915_mm.c +++ b/drivers/gpu/drm/i915/i915_mm.c @@ -91,6 +91,7 @@ int remap_io_mapping(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn, unsigned long size, struct io_mapping *iomap) { +#if defined(CONFIG_X86) struct remap_pfn r; int err; @@ -108,6 +109,7 @@ int remap_io_mapping(struct vm_area_struct *vma, zap_vma_ptes(vma, addr, (r.pfn - pfn) << PAGE_SHIFT); return err; } +#endif return 0; }