Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a71aa396 authored by Víctor Manuel Jáquez Leal's avatar Víctor Manuel Jáquez Leal Committed by Greg Kroah-Hartman
Browse files

staging: tidspbridge: remove cmm_init() and cmm_exit()



The cmm module has a cmm_init() and a cmm_exit() whose only purpose is
to keep a reference counting which is not used at all.

This patch removes these functions and the reference count variable.

There is no functional changes.

Signed-off-by: default avatarVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b4aac487
Loading
Loading
Loading
Loading
+0 −30
Original line number Original line Diff line number Diff line
@@ -79,7 +79,6 @@ extern void *cmm_calloc_buf(struct cmm_object *hcmm_mgr,
 *      -EPERM:      Failed to initialize critical sect sync object.
 *      -EPERM:      Failed to initialize critical sect sync object.
 *
 *
 *  Requires:
 *  Requires:
 *      cmm_init(void) called.
 *      ph_cmm_mgr != NULL.
 *      ph_cmm_mgr != NULL.
 *      mgr_attrts->min_block_size >= 4 bytes.
 *      mgr_attrts->min_block_size >= 4 bytes.
 *  Ensures:
 *  Ensures:
@@ -110,20 +109,6 @@ extern int cmm_create(struct cmm_object **ph_cmm_mgr,
 */
 */
extern int cmm_destroy(struct cmm_object *hcmm_mgr, bool force);
extern int cmm_destroy(struct cmm_object *hcmm_mgr, bool force);


/*
 *  ======== cmm_exit ========
 *  Purpose:
 *     Discontinue usage of module. Cleanup CMM module if CMM cRef reaches zero.
 *  Parameters:
 *     n/a
 *  Returns:
 *     n/a
 *  Requires:
 *     CMM is initialized.
 *  Ensures:
 */
extern void cmm_exit(void);

/*
/*
 *  ======== cmm_free_buf ========
 *  ======== cmm_free_buf ========
 *  Purpose:
 *  Purpose:
@@ -184,19 +169,6 @@ extern int cmm_get_handle(void *hprocessor,
extern int cmm_get_info(struct cmm_object *hcmm_mgr,
extern int cmm_get_info(struct cmm_object *hcmm_mgr,
			       struct cmm_info *cmm_info_obj);
			       struct cmm_info *cmm_info_obj);


/*
 *  ======== cmm_init ========
 *  Purpose:
 *      Initializes private state of CMM module.
 *  Parameters:
 *  Returns:
 *      TRUE if initialized; FALSE if error occurred.
 *  Requires:
 *  Ensures:
 *      CMM initialized.
 */
extern bool cmm_init(void);

/*
/*
 *  ======== cmm_register_gppsm_seg ========
 *  ======== cmm_register_gppsm_seg ========
 *  Purpose:
 *  Purpose:
@@ -333,7 +305,6 @@ extern int cmm_xlator_free_buf(struct cmm_xlatorobject *xlator,
 *      0:        Success.
 *      0:        Success.
 *      -EFAULT:    Bad translator handle.
 *      -EFAULT:    Bad translator handle.
 *  Requires:
 *  Requires:
 *      (refs > 0)
 *      (paddr != NULL)
 *      (paddr != NULL)
 *      (ul_size > 0)
 *      (ul_size > 0)
 *  Ensures:
 *  Ensures:
@@ -355,7 +326,6 @@ extern int cmm_xlator_info(struct cmm_xlatorobject *xlator,
 *  Returns:
 *  Returns:
 *     Valid address on success, else NULL.
 *     Valid address on success, else NULL.
 *  Requires:
 *  Requires:
 *      refs > 0
 *      paddr != NULL
 *      paddr != NULL
 *      xtype >= CMM_VA2PA) && (xtype <= CMM_DSPPA2PA)
 *      xtype >= CMM_VA2PA) && (xtype <= CMM_DSPPA2PA)
 *  Ensures:
 *  Ensures:
+0 −29
Original line number Original line Diff line number Diff line
@@ -131,9 +131,6 @@ struct cmm_mnode {
	u32 client_proc;	/* Process that allocated this mem block */
	u32 client_proc;	/* Process that allocated this mem block */
};
};


/*  ----------------------------------- Globals */
static u32 refs;		/* module reference count */

/*  ----------------------------------- Function Prototypes */
/*  ----------------------------------- Function Prototypes */
static void add_to_free_list(struct cmm_allocator *allocator,
static void add_to_free_list(struct cmm_allocator *allocator,
			     struct cmm_mnode *pnode);
			     struct cmm_mnode *pnode);
@@ -316,17 +313,6 @@ int cmm_destroy(struct cmm_object *hcmm_mgr, bool force)
	return status;
	return status;
}
}


/*
 *  ======== cmm_exit ========
 *  Purpose:
 *      Discontinue usage of module; free resources when reference count
 *      reaches 0.
 */
void cmm_exit(void)
{
	refs--;
}

/*
/*
 *  ======== cmm_free_buf ========
 *  ======== cmm_free_buf ========
 *  Purpose:
 *  Purpose:
@@ -445,21 +431,6 @@ int cmm_get_info(struct cmm_object *hcmm_mgr,
	return status;
	return status;
}
}


/*
 *  ======== cmm_init ========
 *  Purpose:
 *      Initializes private state of CMM module.
 */
bool cmm_init(void)
{
	bool ret = true;

	if (ret)
		refs++;

	return ret;
}

/*
/*
 *  ======== cmm_register_gppsm_seg ========
 *  ======== cmm_register_gppsm_seg ========
 *  Purpose:
 *  Purpose:
+4 −19
Original line number Original line Diff line number Diff line
@@ -658,11 +658,9 @@ void dev_exit(void)
{
{
	refs--;
	refs--;


	if (refs == 0) {
	if (refs == 0)
		cmm_exit();
		dmm_exit();
		dmm_exit();
}
}
}


/*
/*
 *  ======== dev_init ========
 *  ======== dev_init ========
@@ -671,23 +669,10 @@ void dev_exit(void)
 */
 */
bool dev_init(void)
bool dev_init(void)
{
{
	bool cmm_ret, dmm_ret, ret = true;
	bool ret = true;

	if (refs == 0) {
		cmm_ret = cmm_init();
		dmm_ret = dmm_init();

		ret = cmm_ret && dmm_ret;

		if (!ret) {
			if (cmm_ret)
				cmm_exit();


			if (dmm_ret)
	if (refs == 0)
				dmm_exit();
		dmm_init();

		}
	}


	if (ret)
	if (ret)
		refs++;
		refs++;