aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/mlx4/mlx4_core/icm.h6
-rw-r--r--sys/dev/mlx4/mlx4_core/mlx4_fw.c4
-rw-r--r--sys/dev/mthca/mthca_cmd.c4
-rw-r--r--sys/dev/mthca/mthca_memfree.h8
4 files changed, 13 insertions, 9 deletions
diff --git a/sys/dev/mlx4/mlx4_core/icm.h b/sys/dev/mlx4/mlx4_core/icm.h
index 30dac5174f6d..e658f1dd0383 100644
--- a/sys/dev/mlx4/mlx4_core/icm.h
+++ b/sys/dev/mlx4/mlx4_core/icm.h
@@ -43,10 +43,8 @@
((256 - sizeof (struct list_head) - 2 * sizeof (int)) / \
(sizeof (struct scatterlist)))
-enum {
- MLX4_ICM_PAGE_SHIFT = 12,
- MLX4_ICM_PAGE_SIZE = 1 << MLX4_ICM_PAGE_SHIFT,
-};
+#define MLX4_ICM_PAGE_SHIFT 12
+#define MLX4_ICM_PAGE_SIZE (1 << MLX4_ICM_PAGE_SHIFT)
struct mlx4_icm_chunk {
struct list_head list;
diff --git a/sys/dev/mlx4/mlx4_core/mlx4_fw.c b/sys/dev/mlx4/mlx4_core/mlx4_fw.c
index 8ad31b812428..0ac45e1297b9 100644
--- a/sys/dev/mlx4/mlx4_core/mlx4_fw.c
+++ b/sys/dev/mlx4/mlx4_core/mlx4_fw.c
@@ -1707,9 +1707,11 @@ int mlx4_QUERY_FW(struct mlx4_dev *dev)
* Round up number of system pages needed in case
* MLX4_ICM_PAGE_SIZE < PAGE_SIZE.
*/
+#if MLX4_ICM_PAGE_SIZE < PAGE_SIZE
fw->fw_pages =
ALIGN(fw->fw_pages, PAGE_SIZE / MLX4_ICM_PAGE_SIZE) >>
(PAGE_SHIFT - MLX4_ICM_PAGE_SHIFT);
+#endif
mlx4_dbg(dev, "Clear int @ %llx, BAR %d\n",
(unsigned long long) fw->clr_int_base, fw->clr_int_bar);
@@ -2546,8 +2548,10 @@ int mlx4_SET_ICM_SIZE(struct mlx4_dev *dev, u64 icm_size, u64 *aux_pages)
* Round up number of system pages needed in case
* MLX4_ICM_PAGE_SIZE < PAGE_SIZE.
*/
+#if MLX4_ICM_PAGE_SIZE < PAGE_SIZE
*aux_pages = ALIGN(*aux_pages, PAGE_SIZE / MLX4_ICM_PAGE_SIZE) >>
(PAGE_SHIFT - MLX4_ICM_PAGE_SHIFT);
+#endif
return 0;
}
diff --git a/sys/dev/mthca/mthca_cmd.c b/sys/dev/mthca/mthca_cmd.c
index adb76bc9edbd..b4c0dc2f6f1d 100644
--- a/sys/dev/mthca/mthca_cmd.c
+++ b/sys/dev/mthca/mthca_cmd.c
@@ -852,9 +852,11 @@ int mthca_QUERY_FW(struct mthca_dev *dev)
* Round up number of system pages needed in case
* MTHCA_ICM_PAGE_SIZE < PAGE_SIZE.
*/
+#if MTHCA_ICM_PAGE_SIZE < PAGE_SIZE
dev->fw.arbel.fw_pages =
ALIGN(dev->fw.arbel.fw_pages, PAGE_SIZE / MTHCA_ICM_PAGE_SIZE) >>
(PAGE_SHIFT - MTHCA_ICM_PAGE_SHIFT);
+#endif
mthca_dbg(dev, "Clear int @ %llx, EQ arm @ %llx, EQ set CI @ %llx\n",
(unsigned long long) dev->fw.arbel.clr_int_base,
@@ -1588,8 +1590,10 @@ int mthca_SET_ICM_SIZE(struct mthca_dev *dev, u64 icm_size, u64 *aux_pages)
* Round up number of system pages needed in case
* MTHCA_ICM_PAGE_SIZE < PAGE_SIZE.
*/
+#if MTHCA_ICM_PAGE_SIZE < PAGE_SIZE
*aux_pages = ALIGN(*aux_pages, PAGE_SIZE / MTHCA_ICM_PAGE_SIZE) >>
(PAGE_SHIFT - MTHCA_ICM_PAGE_SHIFT);
+#endif
return 0;
}
diff --git a/sys/dev/mthca/mthca_memfree.h b/sys/dev/mthca/mthca_memfree.h
index da9b8f9b884f..9aa10a6a47e1 100644
--- a/sys/dev/mthca/mthca_memfree.h
+++ b/sys/dev/mthca/mthca_memfree.h
@@ -42,11 +42,9 @@
((256 - sizeof (struct list_head) - 2 * sizeof (int)) / \
(sizeof (struct scatterlist)))
-enum {
- MTHCA_ICM_PAGE_SHIFT = 12,
- MTHCA_ICM_PAGE_SIZE = 1 << MTHCA_ICM_PAGE_SHIFT,
- MTHCA_DB_REC_PER_PAGE = MTHCA_ICM_PAGE_SIZE / 8
-};
+#define MTHCA_ICM_PAGE_SHIFT 12
+#define MTHCA_ICM_PAGE_SIZE (1 << MTHCA_ICM_PAGE_SHIFT)
+#define MTHCA_DB_REC_PER_PAGE (MTHCA_ICM_PAGE_SIZE / 8)
struct mthca_icm_chunk {
struct list_head list;