svn commit: r317987 - stable/11/sys/cam/ctl
Alexander Motin
mav at FreeBSD.org
Mon May 8 22:23:03 UTC 2017
Author: mav
Date: Mon May 8 22:23:01 2017
New Revision: 317987
URL: https://svnweb.freebsd.org/changeset/base/317987
Log:
MFC r317369: Slightly compact the code.
Modified:
stable/11/sys/cam/ctl/ctl_backend_block.c
stable/11/sys/cam/ctl/ctl_backend_ramdisk.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- stable/11/sys/cam/ctl/ctl_backend_block.c Mon May 8 21:58:29 2017 (r317986)
+++ stable/11/sys/cam/ctl/ctl_backend_block.c Mon May 8 22:23:01 2017 (r317987)
@@ -2650,11 +2650,8 @@ bailout_error:
static void
ctl_be_block_lun_shutdown(void *be_lun)
{
- struct ctl_be_block_lun *lun;
- struct ctl_be_block_softc *softc;
-
- lun = (struct ctl_be_block_lun *)be_lun;
- softc = lun->softc;
+ struct ctl_be_block_lun *lun = be_lun;
+ struct ctl_be_block_softc *softc = lun->softc;
mtx_lock(&softc->lock);
lun->flags |= CTL_BE_BLOCK_LUN_UNCONFIGURED;
Modified: stable/11/sys/cam/ctl/ctl_backend_ramdisk.c
==============================================================================
--- stable/11/sys/cam/ctl/ctl_backend_ramdisk.c Mon May 8 21:58:29 2017 (r317986)
+++ stable/11/sys/cam/ctl/ctl_backend_ramdisk.c Mon May 8 22:23:01 2017 (r317987)
@@ -1287,13 +1287,8 @@ bailout_error:
static void
ctl_backend_ramdisk_lun_shutdown(void *be_lun)
{
- struct ctl_be_ramdisk_lun *lun;
- struct ctl_be_ramdisk_softc *softc;
- int do_free;
-
- lun = (struct ctl_be_ramdisk_lun *)be_lun;
- softc = lun->softc;
- do_free = 0;
+ struct ctl_be_ramdisk_lun *lun = be_lun;
+ struct ctl_be_ramdisk_softc *softc = lun->softc;
mtx_lock(&softc->lock);
lun->flags |= CTL_BE_RAMDISK_LUN_UNCONFIGURED;
@@ -1303,12 +1298,9 @@ ctl_backend_ramdisk_lun_shutdown(void *b
STAILQ_REMOVE(&softc->lun_list, lun, ctl_be_ramdisk_lun,
links);
softc->num_luns--;
- do_free = 1;
+ free(be_lun, M_RAMDISK);
}
mtx_unlock(&softc->lock);
-
- if (do_free != 0)
- free(be_lun, M_RAMDISK);
}
static void
More information about the svn-src-stable-11
mailing list