Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Víctor Manuel Jáquez Leal and committed by
Greg Kroah-Hartman
a71aa396 b4aac487

+4 -78
-30
drivers/staging/tidspbridge/include/dspbridge/cmm.h
··· 79 79 * -EPERM: Failed to initialize critical sect sync object. 80 80 * 81 81 * Requires: 82 - * cmm_init(void) called. 83 82 * ph_cmm_mgr != NULL. 84 83 * mgr_attrts->min_block_size >= 4 bytes. 85 84 * Ensures: ··· 108 109 * Memory resources used by Cmm Mgr are freed. 109 110 */ 110 111 extern int cmm_destroy(struct cmm_object *hcmm_mgr, bool force); 111 - 112 - /* 113 - * ======== cmm_exit ======== 114 - * Purpose: 115 - * Discontinue usage of module. Cleanup CMM module if CMM cRef reaches zero. 116 - * Parameters: 117 - * n/a 118 - * Returns: 119 - * n/a 120 - * Requires: 121 - * CMM is initialized. 122 - * Ensures: 123 - */ 124 - extern void cmm_exit(void); 125 112 126 113 /* 127 114 * ======== cmm_free_buf ======== ··· 168 183 */ 169 184 extern int cmm_get_info(struct cmm_object *hcmm_mgr, 170 185 struct cmm_info *cmm_info_obj); 171 - 172 - /* 173 - * ======== cmm_init ======== 174 - * Purpose: 175 - * Initializes private state of CMM module. 176 - * Parameters: 177 - * Returns: 178 - * TRUE if initialized; FALSE if error occurred. 179 - * Requires: 180 - * Ensures: 181 - * CMM initialized. 182 - */ 183 - extern bool cmm_init(void); 184 186 185 187 /* 186 188 * ======== cmm_register_gppsm_seg ======== ··· 305 333 * 0: Success. 306 334 * -EFAULT: Bad translator handle. 307 335 * Requires: 308 - * (refs > 0) 309 336 * (paddr != NULL) 310 337 * (ul_size > 0) 311 338 * Ensures: ··· 326 355 * Returns: 327 356 * Valid address on success, else NULL. 328 357 * Requires: 329 - * refs > 0 330 358 * paddr != NULL 331 359 * xtype >= CMM_VA2PA) && (xtype <= CMM_DSPPA2PA) 332 360 * Ensures:
-29
drivers/staging/tidspbridge/pmgr/cmm.c
··· 131 131 u32 client_proc; /* Process that allocated this mem block */ 132 132 }; 133 133 134 - /* ----------------------------------- Globals */ 135 - static u32 refs; /* module reference count */ 136 - 137 134 /* ----------------------------------- Function Prototypes */ 138 135 static void add_to_free_list(struct cmm_allocator *allocator, 139 136 struct cmm_mnode *pnode); ··· 314 317 } 315 318 316 319 /* 317 - * ======== cmm_exit ======== 318 - * Purpose: 319 - * Discontinue usage of module; free resources when reference count 320 - * reaches 0. 321 - */ 322 - void cmm_exit(void) 323 - { 324 - refs--; 325 - } 326 - 327 - /* 328 320 * ======== cmm_free_buf ======== 329 321 * Purpose: 330 322 * Free the given buffer. ··· 429 443 } 430 444 mutex_unlock(&cmm_mgr_obj->cmm_lock); 431 445 return status; 432 - } 433 - 434 - /* 435 - * ======== cmm_init ======== 436 - * Purpose: 437 - * Initializes private state of CMM module. 438 - */ 439 - bool cmm_init(void) 440 - { 441 - bool ret = true; 442 - 443 - if (ret) 444 - refs++; 445 - 446 - return ret; 447 446 } 448 447 449 448 /*
+4 -19
drivers/staging/tidspbridge/pmgr/dev.c
··· 658 658 { 659 659 refs--; 660 660 661 - if (refs == 0) { 662 - cmm_exit(); 661 + if (refs == 0) 663 662 dmm_exit(); 664 - } 665 663 } 666 664 667 665 /* ··· 669 671 */ 670 672 bool dev_init(void) 671 673 { 672 - bool cmm_ret, dmm_ret, ret = true; 674 + bool ret = true; 673 675 674 - if (refs == 0) { 675 - cmm_ret = cmm_init(); 676 - dmm_ret = dmm_init(); 677 - 678 - ret = cmm_ret && dmm_ret; 679 - 680 - if (!ret) { 681 - if (cmm_ret) 682 - cmm_exit(); 683 - 684 - if (dmm_ret) 685 - dmm_exit(); 686 - 687 - } 688 - } 676 + if (refs == 0) 677 + dmm_init(); 689 678 690 679 if (ret) 691 680 refs++;