Commit b86a6767 authored by Zhang Zekun's avatar Zhang Zekun
Browse files

iommu/iova: move IOVA_MAX_GLOBAL_MAGS outside of IOMMU_SUPPORT

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I7I3P1


CVE: NA

--------------------------------------------

The commit 0227a749 introduce
a config CONFIG_IOVA_MAX_GLOBAL_MAGS, but it relies on IOMMU_SUPPORT.
Some drivers can compile without IOMMU_SUPPORT, but still include
include/linux/iova.h, which can cause compile problem. Fix this
by moving the definition of CONFIG_IOVA_MAX_GLOBAL_MAGS out of
IOMMU_SUPPORT.

The error compile message is showned as below:

In file included from ./include/linux/intel-iommu.h:14,
                 from ./include/drm/intel-gtt.h:8,
                 from drivers/char/agp/intel-agp.c:15:
./include/linux/iova.h:29:25: error: ‘CONFIG_IOVA_MAX_GLOBAL_MAGS’ undeclared here (not in a function)
   29 | #define MAX_GLOBAL_MAGS CONFIG_IOVA_MAX_GLOBAL_MAGS /* magazines per bin */
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/iova.h:34:30: note: in expansion of macro ‘MAX_GLOBAL_MAGS’
   34 |  struct iova_magazine *depot[MAX_GLOBAL_MAGS];
      |                              ^~~~~~~~~~~~~~~
In file included from ./include/linux/intel-iommu.h:14,
                 from ./include/drm/intel-gtt.h:8,
                 from drivers/char/agp/intel-gtt.c:27:
./include/linux/iova.h:29:25: error: ‘CONFIG_IOVA_MAX_GLOBAL_MAGS’ undeclared here (not in a function)
   29 | #define MAX_GLOBAL_MAGS CONFIG_IOVA_MAX_GLOBAL_MAGS /* magazines per bin */
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/iova.h:34:30: note: in expansion of macro ‘MAX_GLOBAL_MAGS’
   34 |  struct iova_magazine *depot[MAX_GLOBAL_MAGS];
      |                              ^~~~~~~~~~~~~~~
make[3]: *** [scripts/Makefile.build:286: drivers/char/agp/intel-agp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [scripts/Makefile.build:286: drivers/char/agp/intel-gtt.o] Error 1
make[2]: *** [scripts/Makefile.build:503: drivers/char/agp] Error 2
make[1]: *** [scripts/Makefile.build:503: drivers/char] Error 2
make[1]: *** Waiting for unfinished jobs....

Signed-off-by: default avatarZhang Zekun <zhangzekun11@huawei.com>
parent 82c66282
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment