Date: Mon, 8 May 2017 22:23:01 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317987 - stable/11/sys/cam/ctl Message-ID: <201705082223.v48MN1s5085308@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705082223.v48MN1s5085308>