Date: Mon, 24 Apr 2017 12:44:05 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317369 - head/sys/cam/ctl Message-ID: <201704241244.v3OCi5lc064127@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704241244.v3OCi5lc064127>