lkml.org 
[lkml]   [2015]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 3/3] dm ioctl: Delete an unnecessary check before the function call "dm_table_destroy"
    From: Markus Elfring <elfring@users.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@users.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


    \
     
     \ /
      Last update: 2015-02-02 16:41    [W:4.974 / U:0.944 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site