Skip to contentSkip to conversation

mtd: mtdswap: remove unused variables 'dev' and 'gd'

PATCH In review Brian Norris 1 participant 2 messages Jul 25, 2017 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: mtdswap: remove unused variables 'dev' and 'gd'

This was changed recently (commit e8e3edb95ce6 ("mtd: create per-device and module-scope debugfs entries")) and some compilers are complaining:

drivers//mtd/mtdswap.c: In function 'mtdswap_add_debugfs':

Quoted 1 line
Quoted 1 line

drivers//mtd/mtdswap.c:1317: warning: unused variable 'dev'

And once we kill 'dev', 'gd' is also unused.

Cc Mario J. Rugiero <[email protected]>
---
 drivers/mtd/mtdswap.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/mtd/mtdswap.c +0 -3
index 6b17932fe557..7d9080e33865 100644
@@ -1313,9 +1313,6 @@ static const struct file_operations mtdswap_fops = {
 
 static int mtdswap_add_debugfs(struct mtdswap_dev *d)
 {
-	struct gendisk *gd = d->mbd_dev->disk;
-	struct device *dev = disk_to_dev(gd);
-
 	struct dentry *root = d->mtd->dbg.dfs_dir;
 	struct dentry *dent;
 
Signature · 1 line
2.14.0.rc0.284.gd933b75aa4-goog
#1 lore raw
Quoted 10 lines · Brian Norris

This was changed recently (commit e8e3edb95ce6 ("mtd: create per-device and module-scope debugfs entries")) and some compilers are complaining:

drivers//mtd/mtdswap.c: In function 'mtdswap_add_debugfs':

Quoted 1 line
Quoted 1 line

drivers//mtd/mtdswap.c:1317: warning: unused variable 'dev'

And once we kill 'dev', 'gd' is also unused.

Cc Mario J. Rugiero <[email protected]>

Arnd sent the same thing. Applied this one to l2-mtd.git.

Quoted 21 lines
---
 drivers/mtd/mtdswap.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/mtd/mtdswap.c +0 -3
index 6b17932fe557..7d9080e33865 100644
@@ -1313,9 +1313,6 @@ static const struct file_operations mtdswap_fops = {
 
 static int mtdswap_add_debugfs(struct mtdswap_dev *d)
 {
-	struct gendisk *gd = d->mbd_dev->disk;
-	struct device *dev = disk_to_dev(gd);
-
 	struct dentry *root = d->mtd->dbg.dfs_dir;
 	struct dentry *dent;
 
Signature · 1 line
2.14.0.rc0.284.gd933b75aa4-goog