Date: Thu, 31 Mar 2011 13:36:31 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r220197 - projects/graid/head/sys/geom/raid Message-ID: <201103311336.p2VDaVSo007917@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Thu Mar 31 13:36:31 2011 New Revision: 220197 URL: http://svn.freebsd.org/changeset/base/220197 Log: Remove some unneeded checks. Found with: Coverity Prevent(tm) CID: 9711, 9712, 9713, 9714 Modified: projects/graid/head/sys/geom/raid/md_intel.c projects/graid/head/sys/geom/raid/md_jmicron.c projects/graid/head/sys/geom/raid/md_nvidia.c projects/graid/head/sys/geom/raid/md_sii.c Modified: projects/graid/head/sys/geom/raid/md_intel.c ============================================================================== --- projects/graid/head/sys/geom/raid/md_intel.c Thu Mar 31 13:28:33 2011 (r220196) +++ projects/graid/head/sys/geom/raid/md_intel.c Thu Mar 31 13:36:31 2011 (r220197) @@ -1881,10 +1881,8 @@ g_raid_md_ctl_intel(struct g_raid_md_obj /* If disk was assigned, just update statuses. */ if (pd->pd_disk_pos >= 0) { g_raid_change_disk_state(disk, G_RAID_DISK_S_OFFLINE); - if (disk->d_consumer) { - g_raid_kill_consumer(sc, disk->d_consumer); - disk->d_consumer = NULL; - } + g_raid_kill_consumer(sc, disk->d_consumer); + disk->d_consumer = NULL; TAILQ_FOREACH(sd, &disk->d_subdisks, sd_next) { g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NONE); Modified: projects/graid/head/sys/geom/raid/md_jmicron.c ============================================================================== --- projects/graid/head/sys/geom/raid/md_jmicron.c Thu Mar 31 13:28:33 2011 (r220196) +++ projects/graid/head/sys/geom/raid/md_jmicron.c Thu Mar 31 13:36:31 2011 (r220197) @@ -1303,10 +1303,8 @@ g_raid_md_ctl_jmicron(struct g_raid_md_o /* If disk was assigned, just update statuses. */ if (pd->pd_disk_pos >= 0) { g_raid_change_disk_state(disk, G_RAID_DISK_S_OFFLINE); - if (disk->d_consumer) { - g_raid_kill_consumer(sc, disk->d_consumer); - disk->d_consumer = NULL; - } + g_raid_kill_consumer(sc, disk->d_consumer); + disk->d_consumer = NULL; TAILQ_FOREACH(sd, &disk->d_subdisks, sd_next) { g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NONE); Modified: projects/graid/head/sys/geom/raid/md_nvidia.c ============================================================================== --- projects/graid/head/sys/geom/raid/md_nvidia.c Thu Mar 31 13:28:33 2011 (r220196) +++ projects/graid/head/sys/geom/raid/md_nvidia.c Thu Mar 31 13:36:31 2011 (r220197) @@ -1311,10 +1311,8 @@ g_raid_md_ctl_nvidia(struct g_raid_md_ob /* If disk was assigned, just update statuses. */ if (pd->pd_disk_pos >= 0) { g_raid_change_disk_state(disk, G_RAID_DISK_S_OFFLINE); - if (disk->d_consumer) { - g_raid_kill_consumer(sc, disk->d_consumer); - disk->d_consumer = NULL; - } + g_raid_kill_consumer(sc, disk->d_consumer); + disk->d_consumer = NULL; TAILQ_FOREACH(sd, &disk->d_subdisks, sd_next) { g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NONE); Modified: projects/graid/head/sys/geom/raid/md_sii.c ============================================================================== --- projects/graid/head/sys/geom/raid/md_sii.c Thu Mar 31 13:28:33 2011 (r220196) +++ projects/graid/head/sys/geom/raid/md_sii.c Thu Mar 31 13:36:31 2011 (r220197) @@ -1389,10 +1389,8 @@ g_raid_md_ctl_sii(struct g_raid_md_objec /* If disk was assigned, just update statuses. */ if (pd->pd_disk_pos >= 0) { g_raid_change_disk_state(disk, G_RAID_DISK_S_OFFLINE); - if (disk->d_consumer) { - g_raid_kill_consumer(sc, disk->d_consumer); - disk->d_consumer = NULL; - } + g_raid_kill_consumer(sc, disk->d_consumer); + disk->d_consumer = NULL; TAILQ_FOREACH(sd, &disk->d_subdisks, sd_next) { g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NONE);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103311336.p2VDaVSo007917>