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

mailbox: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value. The function can work or not, but the code logic should
never do something different based on this.

Cc: Jassi Brar <jassisinghbrar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+7 -29
+5 -23
drivers/mailbox/bcm-flexrm-mailbox.c
··· 296 296 struct dma_pool *bd_pool; 297 297 struct dma_pool *cmpl_pool; 298 298 struct dentry *root; 299 - struct dentry *config; 300 - struct dentry *stats; 301 299 struct mbox_controller controller; 302 300 }; 303 301 ··· 1601 1603 1 << RING_CMPL_ALIGN_ORDER, 0); 1602 1604 if (!mbox->cmpl_pool) { 1603 1605 ret = -ENOMEM; 1604 - goto fail_destroy_bd_pool; 1605 1606 } 1606 1607 1607 1608 /* Allocate platform MSIs for each ring */ ··· 1621 1624 1622 1625 /* Create debugfs root entry */ 1623 1626 mbox->root = debugfs_create_dir(dev_name(mbox->dev), NULL); 1624 - if (IS_ERR_OR_NULL(mbox->root)) { 1625 - ret = PTR_ERR_OR_ZERO(mbox->root); 1626 - goto fail_free_msis; 1627 - } 1628 1627 1629 1628 /* Create debugfs config entry */ 1630 - mbox->config = debugfs_create_devm_seqfile(mbox->dev, 1631 - "config", mbox->root, 1632 - flexrm_debugfs_conf_show); 1633 - if (IS_ERR_OR_NULL(mbox->config)) { 1634 - ret = PTR_ERR_OR_ZERO(mbox->config); 1635 - goto fail_free_debugfs_root; 1636 - } 1629 + debugfs_create_devm_seqfile(mbox->dev, "config", mbox->root, 1630 + flexrm_debugfs_conf_show); 1637 1631 1638 1632 /* Create debugfs stats entry */ 1639 - mbox->stats = debugfs_create_devm_seqfile(mbox->dev, 1640 - "stats", mbox->root, 1641 - flexrm_debugfs_stats_show); 1642 - if (IS_ERR_OR_NULL(mbox->stats)) { 1643 - ret = PTR_ERR_OR_ZERO(mbox->stats); 1644 - goto fail_free_debugfs_root; 1645 - } 1633 + debugfs_create_devm_seqfile(mbox->dev, "stats", mbox->root, 1634 + flexrm_debugfs_stats_show); 1635 + 1646 1636 skip_debugfs: 1647 1637 1648 1638 /* Initialize mailbox controller */ ··· 1660 1676 1661 1677 fail_free_debugfs_root: 1662 1678 debugfs_remove_recursive(mbox->root); 1663 - fail_free_msis: 1664 1679 platform_msi_domain_free_irqs(dev); 1665 1680 fail_destroy_cmpl_pool: 1666 1681 dma_pool_destroy(mbox->cmpl_pool); 1667 - fail_destroy_bd_pool: 1668 1682 dma_pool_destroy(mbox->bd_pool); 1669 1683 fail: 1670 1684 return ret;
+2 -6
drivers/mailbox/bcm-pdc-mailbox.c
··· 406 406 */ 407 407 struct scatterlist *src_sg[PDC_RING_ENTRIES]; 408 408 409 - struct dentry *debugfs_stats; /* debug FS stats file for this PDC */ 410 - 411 409 /* counters */ 412 410 u32 pdc_requests; /* number of request messages submitted */ 413 411 u32 pdc_replies; /* number of reply messages received */ ··· 510 512 debugfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL); 511 513 512 514 /* S_IRUSR == 0400 */ 513 - pdcs->debugfs_stats = debugfs_create_file(spu_stats_name, 0400, 514 - debugfs_dir, pdcs, 515 - &pdc_debugfs_stats); 515 + debugfs_create_file(spu_stats_name, 0400, debugfs_dir, pdcs, 516 + &pdc_debugfs_stats); 516 517 } 517 518 518 519 static void pdc_free_debugfs(void) ··· 1611 1614 if (err) 1612 1615 goto cleanup_buf_pool; 1613 1616 1614 - pdcs->debugfs_stats = NULL; 1615 1617 pdc_setup_debugfs(pdcs); 1616 1618 1617 1619 dev_dbg(dev, "pdc_probe() successful");