svn commit: r317369 - head/sys/cam/ctl
Alexander Motin
mav at FreeBSD.org
Mon Apr 24 12:44:06 UTC 2017
Author: mav
Date: Mon Apr 24 12:44:04 2017
New Revision: 317369
URL: https://svnweb.freebsd.org/changeset/base/317369
Log:
Slightly compact the code.
MFC after: 2 weeks
Modified:
head/sys/cam/ctl/ctl_backend_block.c
head/sys/cam/ctl/ctl_backend_ramdisk.c
Modified: head/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_block.c Mon Apr 24 11:34:02 2017 (r317368)
+++ head/sys/cam/ctl/ctl_backend_block.c Mon Apr 24 12:44:04 2017 (r317369)
@@ -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: head/sys/cam/ctl/ctl_backend_ramdisk.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_ramdisk.c Mon Apr 24 11:34:02 2017 (r317368)
+++ head/sys/cam/ctl/ctl_backend_ramdisk.c Mon Apr 24 12:44:04 2017 (r317369)
@@ -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-all
mailing list