mtd: mtdswap: use MTDSWAP_ECNT_MIN/MAX

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Wed May 10 19:59:02 PDT 2017


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=e4a8aad8e070e54e486666cc8bb97d69dc81adfb
Commit:     e4a8aad8e070e54e486666cc8bb97d69dc81adfb
Parent:     e8348dc554f108f603101bc49ff897f0c9313c23
Author:     Geliang Tang <geliangtang at gmail.com>
AuthorDate: Tue Dec 20 21:54:33 2016 +0800
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Wed Apr 19 13:12:02 2017 -0700

    mtd: mtdswap: use MTDSWAP_ECNT_MIN/MAX
    
    Since macros MTDSWAP_ECNT_MIN() and MTDSWAP_ECNT_MAX() have been
    defined in mtdswap.c, use them instead of open-coding.
    
    Signed-off-by: Geliang Tang <geliangtang at gmail.com>
    Acked-by: Marek Vasut <marek.vasut at gmail.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/mtdswap.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/mtdswap.c b/drivers/mtd/mtdswap.c
index c40e2c9..f12879a 100644
--- a/drivers/mtd/mtdswap.c
+++ b/drivers/mtd/mtdswap.c
@@ -1235,10 +1235,8 @@ static int mtdswap_show(struct seq_file *s, void *data)
 
 		if (root->rb_node) {
 			count[i] = d->trees[i].count;
-			min[i] = rb_entry(rb_first(root), struct swap_eb,
-					rb)->erase_count;
-			max[i] = rb_entry(rb_last(root), struct swap_eb,
-					rb)->erase_count;
+			min[i] = MTDSWAP_ECNT_MIN(root);
+			max[i] = MTDSWAP_ECNT_MAX(root);
 		} else
 			count[i] = 0;
 	}



More information about the linux-mtd-cvs mailing list