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

staging: tidspbridge: remove node_init() and node_exit()

The node module has a node_init() and a node_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
18ff1592 02a63f9d

+1 -72
-41
drivers/staging/tidspbridge/include/dspbridge/node.h
··· 47 47 * -EPERM: A failure occurred, unable to allocate node. 48 48 * -EBADR: Proccessor is not in the running state. 49 49 * Requires: 50 - * node_init(void) called. 51 50 * hprocessor != NULL. 52 51 * node_uuid != NULL. 53 52 * noderes != NULL. ··· 80 81 * -EPERM: General Failure. 81 82 * -EINVAL: Invalid Size. 82 83 * Requires: 83 - * node_init(void) called. 84 84 * pbuffer != NULL. 85 85 * Ensures: 86 86 */ ··· 104 106 * or NODE_RUNNING state. 105 107 * -ETIME: A timeout occurred before the DSP responded. 106 108 * Requires: 107 - * node_init(void) called. 108 109 * Ensures: 109 110 * 0 && (Node's current priority == prio) 110 111 */ ··· 154 157 * Device node to device node, or device node to 155 158 * GPP), the two nodes are on different DSPs. 156 159 * Requires: 157 - * node_init(void) called. 158 160 * Ensures: 159 161 */ 160 162 extern int node_connect(struct node_object *node1, ··· 181 185 * -ETIME: A timeout occurred before the DSP responded. 182 186 * -EPERM: A failure occurred, unable to create node. 183 187 * Requires: 184 - * node_init(void) called. 185 188 * Ensures: 186 189 */ 187 190 extern int node_create(struct node_object *hnode); ··· 201 206 * -ENOMEM: Insufficient memory for requested resources. 202 207 * -EPERM: General failure. 203 208 * Requires: 204 - * node_init(void) called. 205 209 * node_man != NULL. 206 210 * hdev_obj != NULL. 207 211 * Ensures: ··· 228 234 * -EPERM: A failure occurred in deleting the node. 229 235 * -ESPIPE: Delete function not found in the COFF file. 230 236 * Requires: 231 - * node_init(void) called. 232 237 * Ensures: 233 238 * 0: hnode is invalid. 234 239 */ ··· 243 250 * Returns: 244 251 * 0: Success. 245 252 * Requires: 246 - * node_init(void) called. 247 253 * Valid hnode_mgr. 248 254 * Ensures: 249 255 */ ··· 279 287 u32 *pu_allocated); 280 288 281 289 /* 282 - * ======== node_exit ======== 283 - * Purpose: 284 - * Discontinue usage of NODE module. 285 - * Parameters: 286 - * Returns: 287 - * Requires: 288 - * node_init(void) successfully called before. 289 - * Ensures: 290 - * Any resources acquired in node_init(void) will be freed when last NODE 291 - * client calls node_exit(void). 292 - */ 293 - extern void node_exit(void); 294 - 295 - /* 296 290 * ======== node_free_msg_buf ======== 297 291 * Purpose: 298 292 * Free a message buffer previously allocated with node_alloc_msg_buf. ··· 291 313 * -EFAULT: Invalid node handle. 292 314 * -EPERM: Failure to free the buffer. 293 315 * Requires: 294 - * node_init(void) called. 295 316 * pbuffer != NULL. 296 317 * Ensures: 297 318 */ ··· 313 336 * 0: Success. 314 337 * -EFAULT: Invalid hnode. 315 338 * Requires: 316 - * node_init(void) called. 317 339 * pattr != NULL. 318 340 * Ensures: 319 341 * 0: *pattrs contains the node's current attributes. ··· 339 363 * Error occurred while trying to retrieve a message. 340 364 * -ETIME: Timeout occurred and no message is available. 341 365 * Requires: 342 - * node_init(void) called. 343 366 * message != NULL. 344 367 * Ensures: 345 368 */ ··· 359 384 */ 360 385 extern int node_get_nldr_obj(struct node_mgr *hnode_mgr, 361 386 struct nldr_object **nldr_ovlyobj); 362 - 363 - /* 364 - * ======== node_init ======== 365 - * Purpose: 366 - * Initialize the NODE module. 367 - * Parameters: 368 - * Returns: 369 - * TRUE if initialization succeeded, FALSE otherwise. 370 - * Ensures: 371 - */ 372 - extern bool node_init(void); 373 387 374 388 /* 375 389 * ======== node_on_exit ======== ··· 389 425 * -ETIME: A timeout occurred before the DSP responded. 390 426 * DSP_EWRONGSTSATE: Node is not in NODE_RUNNING state. 391 427 * Requires: 392 - * node_init(void) called. 393 428 * Ensures: 394 429 */ 395 430 extern int node_pause(struct node_object *hnode); ··· 412 449 * -ETIME: Timeout occurred before message could be set. 413 450 * -EBADR: Node is in invalid state for sending messages. 414 451 * Requires: 415 - * node_init(void) called. 416 452 * pmsg != NULL. 417 453 * Ensures: 418 454 */ ··· 435 473 * -ENOSYS: Notification type specified by notify_type is not 436 474 * supported. 437 475 * Requires: 438 - * node_init(void) called. 439 476 * hnotification != NULL. 440 477 * Ensures: 441 478 */ ··· 461 500 * DSP_EWRONGSTSATE: Node is not in NODE_PAUSED or NODE_CREATED state. 462 501 * -ESPIPE: Execute function not found in the COFF file. 463 502 * Requires: 464 - * node_init(void) called. 465 503 * Ensures: 466 504 */ 467 505 extern int node_run(struct node_object *hnode); ··· 483 523 * Unable to terminate the node. 484 524 * -EBADR: Operation not valid for the current node state. 485 525 * Requires: 486 - * node_init(void) called. 487 526 * pstatus != NULL. 488 527 * Ensures: 489 528 */
-1
drivers/staging/tidspbridge/include/dspbridge/nodepriv.h
··· 96 96 * -EINVAL: The node's stream corresponding to index and dir 97 97 * is not a stream to or from the host. 98 98 * Requires: 99 - * node_init(void) called. 100 99 * Valid dir. 101 100 * chan_id != NULL. 102 101 * Ensures:
+1 -6
drivers/staging/tidspbridge/pmgr/dspapi.c
··· 273 273 io_exit(); 274 274 strm_exit(); 275 275 disp_exit(); 276 - node_exit(); 277 276 mgr_exit(); 278 277 rmm_exit(); 279 278 } ··· 287 288 { 288 289 bool ret = true; 289 290 bool fdev, fchnl, fmsg, fio; 290 - bool fmgr, fnode, fdisp, fstrm, frmm; 291 + bool fmgr, fdisp, fstrm, frmm; 291 292 292 293 if (api_c_refs == 0) { 293 294 /* initialize driver and other modules */ 294 295 fmgr = mgr_init(); 295 - fnode = node_init(); 296 296 fdisp = disp_init(); 297 297 fstrm = strm_init(); 298 298 frmm = rmm_init(); ··· 308 310 309 311 if (fstrm) 310 312 strm_exit(); 311 - 312 - if (fnode) 313 - node_exit(); 314 313 315 314 if (fdisp) 316 315 disp_exit();
-24
drivers/staging/tidspbridge/rmgr/node.c
··· 261 261 static u32 mem_write(void *priv_ref, u32 dsp_add, void *pbuf, 262 262 u32 ul_num_bytes, u32 mem_space); 263 263 264 - static u32 refs; /* module reference count */ 265 - 266 264 /* Dynamic loader functions. */ 267 265 static struct node_ldr_fxns nldr_fxns = { 268 266 nldr_allocate, ··· 1567 1569 } 1568 1570 1569 1571 /* 1570 - * ======== node_exit ======== 1571 - * Purpose: 1572 - * Discontinue usage of NODE module. 1573 - */ 1574 - void node_exit(void) 1575 - { 1576 - refs--; 1577 - } 1578 - 1579 - /* 1580 1572 * ======== node_free_msg_buf ======== 1581 1573 * Purpose: 1582 1574 * Frees the message buffer. ··· 1837 1849 node_type = hnode->ntype; 1838 1850 } 1839 1851 return node_type; 1840 - } 1841 - 1842 - /* 1843 - * ======== node_init ======== 1844 - * Purpose: 1845 - * Initialize the NODE module. 1846 - */ 1847 - bool node_init(void) 1848 - { 1849 - refs++; 1850 - 1851 - return true; 1852 1852 } 1853 1853 1854 1854 /*