memory: tegra: Delete dead debugfs checking code
PATCH 1/1 memory: tegra: Delete dead debugfs checking code
The debugfs_create_dir() function does not return NULL, it returns error pointers. But in normal situations like this where the caller is not dereferencing "emc->debugfs.root" then we are not supposed to check the return. So instead of fixing these checks, we should delete them.
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/memory/tegra/tegra124-emc.c | 4 ---- drivers/memory/tegra/tegra20-emc.c | 4 ---- drivers/memory/tegra/tegra210-emc-core.c | 4 ---- drivers/memory/tegra/tegra30-emc.c | 4 ---- 4 files changed, 16 deletions(-)
drivers/memory/tegra/tegra124-emc.c +0 -4
@@ -1269,10 +1269,6 @@ static void emc_debugfs_init(struct device *dev, struct tegra_emc *emc) } emc->debugfs.root =debugfs_create_dir ("emc" ,NULL ); -if (!emc->debugfs.root) { -dev_err (dev,"failed to create debugfs directory\n" ); -return ; - }debugfs_create_file ("available_rates" ,0444 , emc->debugfs.root, emc, &tegra_emc_debug_available_rates_fops);
drivers/memory/tegra/tegra20-emc.c +0 -4
@@ -776,10 +776,6 @@ static void tegra_emc_debugfs_init(struct tegra_emc *emc) } emc->debugfs.root =debugfs_create_dir ("emc" ,NULL ); -if (!emc->debugfs.root) { -dev_err (emc->dev,"failed to create debugfs directory\n" ); -return ; - }debugfs_create_file ("available_rates" ,0444 , emc->debugfs.root, emc, &tegra_emc_debug_available_rates_fops);
drivers/memory/tegra/tegra210-emc-core.c +0 -4
@@ -1759,10 +1759,6 @@ static void tegra210_emc_debugfs_init(struct tegra210_emc *emc) } emc->debugfs.root =debugfs_create_dir ("emc" ,NULL ); -if (!emc->debugfs.root) { -dev_err (dev,"failed to create debugfs directory\n" ); -return ; - }debugfs_create_file ("available_rates" ,0444 , emc->debugfs.root, emc, &tegra210_emc_debug_available_rates_fops);
drivers/memory/tegra/tegra30-emc.c +0 -4
@@ -1354,10 +1354,6 @@ static void tegra_emc_debugfs_init(struct tegra_emc *emc) } emc->debugfs.root =debugfs_create_dir ("emc" ,NULL ); -if (!emc->debugfs.root) { -dev_err (emc->dev,"failed to create debugfs directory\n" ); -return ; - }debugfs_create_file ("available_rates" ,0444 , emc->debugfs.root, emc, &tegra_emc_debug_available_rates_fops);
Signature · 1 line
2.30.2
Krzysztof Kozlowski
AppliedQuoted 4 lines · Dan Carpenter
The
debugfs_create_dir()function does not return NULL, it returns error pointers. But in normal situations like this where the caller is not dereferencing "emc->debugfs.root" then we are not supposed to check the return. So instead of fixing these checks, we should delete them.
Applied, thanks!
[1/1] memory: tegra: Delete dead debugfs checking code
commit: c7c65703260c88a3e4d7387b2d03023c3625c6d4
Best regards,
Signature · 1 line
Krzysztof Kozlowski <[email protected]>