[dm-devel] [PATCH 7/9] md/dm-table: Adjust one function call together with a variable assignment

SF Markus Elfring elfring at users.sourceforge.net
Sat Oct 1 07:50:42 UTC 2016


From: Markus Elfring <elfring at users.sourceforge.net>
Date: Sat, 1 Oct 2016 08:53:37 +0200

The script "checkpatch.pl" pointed information out like the following.

ERROR: do not use assignment in if condition

Thus fix the affected source code place.

Signed-off-by: Markus Elfring <elfring at users.sourceforge.net>
---
 drivers/md/dm-table.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 9b7d8b7..40dde87 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -407,7 +407,8 @@ int dm_get_device(struct dm_target *ti, const char *path, fmode_t mode,
 		if (!dd)
 			return -ENOMEM;
 
-		if ((r = dm_get_table_device(t->md, dev, mode, &dd->dm_dev))) {
+		r = dm_get_table_device(t->md, dev, mode, &dd->dm_dev);
+		if (r) {
 			kfree(dd);
 			return r;
 		}
-- 
2.10.0




More information about the dm-devel mailing list