[dm-devel] [PATCH 5/6] dm-switch: Remove unnecessary condition in conditional

Tomohiro Kusumi kusumi.tomohiro at gmail.com
Tue Oct 27 19:38:59 UTC 2015


It's always (sctx->nr_regions == nr_regions) considering
the assignment right before this conditional, and this
function is only used by .ctr.

Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
---
 drivers/md/dm-switch.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/md/dm-switch.c b/drivers/md/dm-switch.c
index 50fca46..372ec34 100644
--- a/drivers/md/dm-switch.c
+++ b/drivers/md/dm-switch.c
@@ -100,7 +100,7 @@ static int alloc_region_table(struct dm_target *ti, unsigned nr_paths)
 		nr_regions++;
 
 	sctx->nr_regions = nr_regions;
-	if (sctx->nr_regions != nr_regions || sctx->nr_regions >= ULONG_MAX) {
+	if (sctx->nr_regions >= ULONG_MAX) {
 		ti->error = "Region table too large";
 		return -EINVAL;
 	}
-- 
1.7.1




More information about the dm-devel mailing list