[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 02 Feb 2015 16:23:18 +0100
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: Alasdair Kergon <agk@...hat.com>,
Mike Snitzer <snitzer@...hat.com>, Neil Brown <neilb@...e.de>,
dm-devel@...hat.com, linux-raid@...r.kernel.org
CC: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH 3/3] dm ioctl: Delete an unnecessary check before the function
call "dm_table_destroy"
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Mon, 2 Feb 2015 15:30:37 +0100
The dm_table_destroy() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/md/dm-ioctl.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index 73f791b..4fac6cf 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -1053,8 +1053,7 @@ static int do_resume(struct dm_ioctl *param)
* Since dm_swap_table synchronizes RCU, nobody should be in
* read-side critical section already.
*/
- if (old_map)
- dm_table_destroy(old_map);
+ dm_table_destroy(old_map);
if (!r)
__dev_status(md, param);
--
2.2.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists