[PATCH v2 4/4] staging: media: atomisp: remove include/hmm/hmm_common.h file
From: Nikolay Kulikov
Date: Thu Jul 23 2026 - 15:13:22 EST
Replace the last used macro with a conditional expression and remove
this header file, as it no longer contains any code that is being used.
Signed-off-by: Nikolay Kulikov <nikolayof23@xxxxxxxxx>
---
.../staging/media/atomisp/include/hmm/hmm.h | 1 -
.../media/atomisp/include/hmm/hmm_bo.h | 1 -
.../media/atomisp/include/hmm/hmm_common.h | 36 -------------------
.../staging/media/atomisp/pci/hmm/hmm_bo.c | 9 +++--
4 files changed, 6 insertions(+), 41 deletions(-)
delete mode 100644 drivers/staging/media/atomisp/include/hmm/hmm_common.h
diff --git a/drivers/staging/media/atomisp/include/hmm/hmm.h b/drivers/staging/media/atomisp/include/hmm/hmm.h
index 6bda02b9ff85..be92a9c9046f 100644
--- a/drivers/staging/media/atomisp/include/hmm/hmm.h
+++ b/drivers/staging/media/atomisp/include/hmm/hmm.h
@@ -15,7 +15,6 @@
#include <linux/slab.h>
#include <linux/mm.h>
-#include "hmm_common.h"
#include "hmm/hmm_bo.h"
#include "ia_css_types.h"
diff --git a/drivers/staging/media/atomisp/include/hmm/hmm_bo.h b/drivers/staging/media/atomisp/include/hmm/hmm_bo.h
index 69cf490bd88c..2a19e3b2c1f9 100644
--- a/drivers/staging/media/atomisp/include/hmm/hmm_bo.h
+++ b/drivers/staging/media/atomisp/include/hmm/hmm_bo.h
@@ -16,7 +16,6 @@
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include "mmu/isp_mmu.h"
-#include "hmm/hmm_common.h"
#include "ia_css_types.h"
#define rbtree_node_to_hmm_bo(root_node) \
diff --git a/drivers/staging/media/atomisp/include/hmm/hmm_common.h b/drivers/staging/media/atomisp/include/hmm/hmm_common.h
deleted file mode 100644
index c406fe8b1345..000000000000
--- a/drivers/staging/media/atomisp/include/hmm/hmm_common.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Support for Medifield PNW Camera Imaging ISP subsystem.
- *
- * Copyright (c) 2010 Intel Corporation. All Rights Reserved.
- *
- * Copyright (c) 2010 Silicon Hive www.siliconhive.com.
- */
-
-#ifndef __HMM_BO_COMMON_H__
-#define __HMM_BO_COMMON_H__
-
-#define HMM_BO_NAME "HMM"
-
-/*
- * some common use micros
- */
-#define var_equal_return(var1, var2, exp, fmt, arg ...) \
- do { \
- if ((var1) == (var2)) { \
- dev_err(atomisp_dev, \
- fmt, ## arg); \
- return exp;\
- } \
- } while (0)
-
-#define var_equal_return_void(var1, var2, fmt, arg ...) \
- do { \
- if ((var1) == (var2)) { \
- dev_err(atomisp_dev, \
- fmt, ## arg); \
- return;\
- } \
- } while (0)
-
-#endif
diff --git a/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c b/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c
index e92538ab025e..dd1897cdf662 100644
--- a/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c
+++ b/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c
@@ -30,7 +30,6 @@
#include <asm/set_memory.h>
#include "atomisp_internal.h"
-#include "hmm/hmm_common.h"
#include "hmm/hmm_bo.h"
static int __bo_init(struct hmm_bo_device *bdev, struct hmm_buffer_object *bo,
@@ -389,6 +388,7 @@ struct hmm_buffer_object *hmm_bo_alloc(struct hmm_bo_device *bdev,
{
struct hmm_buffer_object *bo, *new_bo;
struct rb_root *root;
+ int ret;
if (!bdev) {
dev_err(atomisp_dev, "NULL hmm_bo_device.\n");
@@ -396,8 +396,11 @@ struct hmm_buffer_object *hmm_bo_alloc(struct hmm_bo_device *bdev,
}
root = &bdev->free_rbtree;
- var_equal_return(hmm_bo_device_inited(bdev), 0, NULL,
- "hmm_bo_device not inited yet.\n");
+ ret = hmm_bo_device_inited(bdev);
+ if (!ret) {
+ dev_err(atomisp_dev, "hmm_bo_device not inited yet.\n");
+ return NULL;
+ }
if (pgnr == 0) {
dev_err(atomisp_dev, "0 size buffer is not allowed.\n");
--
2.55.0