Date: Fri, 12 Feb 2016 22:46:14 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295586 - head/sys/fs/cd9660 Message-ID: <201602122246.u1CMkEDO065856@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Fri Feb 12 22:46:14 2016 New Revision: 295586 URL: https://svnweb.freebsd.org/changeset/base/295586 Log: cd9660: More "check for NULL" cleaunps. Cleanup some checks for NULL. Most of these were always unnecessary and starting with r294954 brelse() doesn't need any NULL checks at all. For now keep the checks somewhat consistent with NetBSD in case we want to merge the cleanups to older versions. Modified: head/sys/fs/cd9660/cd9660_vfsops.c Modified: head/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vfsops.c Fri Feb 12 21:46:20 2016 (r295585) +++ head/sys/fs/cd9660/cd9660_vfsops.c Fri Feb 12 22:46:14 2016 (r295586) @@ -309,13 +309,13 @@ iso_mountfs(devvp, mp) default: break; } - if (bp) { + if (bp != NULL) { brelse(bp); bp = NULL; } } vd_end: - if (bp) { + if (bp != NULL) { brelse(bp); bp = NULL; } @@ -474,11 +474,11 @@ iso_mountfs(devvp, mp) return 0; out: - if (bp) + if (bp != NULL) brelse(bp); - if (pribp) + if (pribp != NULL) brelse(pribp); - if (supbp) + if (supbp != NULL) brelse(supbp); if (cp != NULL) { DROP_GIANT(); @@ -751,8 +751,7 @@ cd9660_vget_internal(mp, ino, flags, vpp #if 0 if (isonum_733(isodir->extent) + isonum_711(isodir->ext_attr_length) != ifhp->ifid_start) { - if (bp != 0) - brelse(bp); + brelse(bp); printf("fhtovp: file start miss %d vs %d\n", isonum_733(isodir->extent) + isonum_711(isodir->ext_attr_length), ifhp->ifid_start); @@ -770,7 +769,7 @@ cd9660_vget_internal(mp, ino, flags, vpp * read the `.' entry out of a dir. */ ip->iso_start = ino >> imp->im_bshift; - if (bp != 0) + if (bp != NULL) brelse(bp); if ((error = cd9660_blkatoff(vp, (off_t)0, NULL, &bp)) != 0) { vput(vp); @@ -809,8 +808,7 @@ cd9660_vget_internal(mp, ino, flags, vpp break; } - if (bp != 0) - brelse(bp); + brelse(bp); /* * Initialize the associated vnode
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602122246.u1CMkEDO065856>