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

dmaengine: qcom: hidma: 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.

Also, because there is no need to save the file dentry, remove the
variables that were saving them as they were never even being used once
set.

Cc: Sinan Kaya <okaya@kernel.org>
Cc: Andy Gross <agross@kernel.org>
Cc: David Brown <david.brown@linaro.org>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Vinod Koul <vkoul@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-arm-msm@vger.kernel.org
Cc: dmaengine@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Sinan Kaya <okaya@kernel.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Greg Kroah-Hartman and committed by
Vinod Koul
a08a9645 bea696c5

+8 -34
+1 -4
drivers/dma/qcom/hidma.h
··· 101 101 * It is used by the DMA complete notification to 102 102 * locate the descriptor that initiated the transfer. 103 103 */ 104 - struct dentry *debugfs; 105 - struct dentry *stats; 106 104 struct hidma_dev *dmadev; 107 105 struct hidma_desc *running; 108 106 ··· 132 134 struct dma_device ddev; 133 135 134 136 struct dentry *debugfs; 135 - struct dentry *stats; 136 137 137 138 /* sysfs entry for the channel id */ 138 139 struct device_attribute *chid_attrs; ··· 163 166 irqreturn_t hidma_ll_inthandler_msi(int irq, void *arg, int cause); 164 167 void hidma_cleanup_pending_tre(struct hidma_lldev *llhndl, u8 err_info, 165 168 u8 err_code); 166 - int hidma_debug_init(struct hidma_dev *dmadev); 169 + void hidma_debug_init(struct hidma_dev *dmadev); 167 170 void hidma_debug_uninit(struct hidma_dev *dmadev); 168 171 #endif
+7 -30
drivers/dma/qcom/hidma_dbg.c
··· 146 146 debugfs_remove_recursive(dmadev->debugfs); 147 147 } 148 148 149 - int hidma_debug_init(struct hidma_dev *dmadev) 149 + void hidma_debug_init(struct hidma_dev *dmadev) 150 150 { 151 - int rc = 0; 152 151 int chidx = 0; 153 152 struct list_head *position = NULL; 153 + struct dentry *dir; 154 154 155 155 dmadev->debugfs = debugfs_create_dir(dev_name(dmadev->ddev.dev), NULL); 156 - if (!dmadev->debugfs) { 157 - rc = -ENODEV; 158 - return rc; 159 - } 160 156 161 157 /* walk through the virtual channel list */ 162 158 list_for_each(position, &dmadev->ddev.channels) { ··· 161 165 chan = list_entry(position, struct hidma_chan, 162 166 chan.device_node); 163 167 sprintf(chan->dbg_name, "chan%d", chidx); 164 - chan->debugfs = debugfs_create_dir(chan->dbg_name, 168 + dir = debugfs_create_dir(chan->dbg_name, 165 169 dmadev->debugfs); 166 - if (!chan->debugfs) { 167 - rc = -ENOMEM; 168 - goto cleanup; 169 - } 170 - chan->stats = debugfs_create_file("stats", S_IRUGO, 171 - chan->debugfs, chan, 172 - &hidma_chan_fops); 173 - if (!chan->stats) { 174 - rc = -ENOMEM; 175 - goto cleanup; 176 - } 170 + debugfs_create_file("stats", S_IRUGO, dir, chan, 171 + &hidma_chan_fops); 177 172 chidx++; 178 173 } 179 174 180 - dmadev->stats = debugfs_create_file("stats", S_IRUGO, 181 - dmadev->debugfs, dmadev, 182 - &hidma_dma_fops); 183 - if (!dmadev->stats) { 184 - rc = -ENOMEM; 185 - goto cleanup; 186 - } 187 - 188 - return 0; 189 - cleanup: 190 - hidma_debug_uninit(dmadev); 191 - return rc; 175 + debugfs_create_file("stats", S_IRUGO, dmadev->debugfs, dmadev, 176 + &hidma_dma_fops); 192 177 }