svn commit: r220197 - projects/graid/head/sys/geom/raid
Alexander Motin
mav at FreeBSD.org
Thu Mar 31 13:36:31 UTC 2011
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);
More information about the svn-src-projects
mailing list