Fix gcc missing case warnings

Gcc ASSERT() missing cases are impossible

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
Brian Behlendorf
2010-08-26 09:52:41 -07:00
parent 2598c0012d
commit e75c13c353
12 changed files with 51 additions and 1 deletions
+2
View File
@@ -131,6 +131,8 @@ changelist_prefix(prop_changelist_t *clp)
case ZFS_PROP_SHARESMB:
(void) zfs_unshare_smb(cn->cn_handle, NULL);
break;
default:
break;
}
}
}
+12
View File
@@ -72,6 +72,8 @@ zfs_type_to_name(zfs_type_t type)
return (dgettext(TEXT_DOMAIN, "snapshot"));
case ZFS_TYPE_VOLUME:
return (dgettext(TEXT_DOMAIN, "volume"));
default:
break;
}
return (NULL);
@@ -180,6 +182,8 @@ zfs_validate_name(libzfs_handle_t *hdl, const char *path, int type,
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"reserved disk name"));
break;
default:
break;
}
}
@@ -1015,6 +1019,8 @@ badlabel:
"component of '%s' is too long"),
propname);
break;
default:
break;
}
(void) zfs_error(hdl, EZFS_BADPROP, errbuf);
goto error;
@@ -1139,6 +1145,8 @@ badlabel:
case ZFS_PROP_NORMALIZE:
chosen_normal = (int)intval;
break;
default:
break;
}
/*
@@ -1187,6 +1195,8 @@ badlabel:
goto error;
}
break;
default:
break;
}
}
}
@@ -1674,6 +1684,8 @@ get_numeric_property(zfs_handle_t *zhp, zfs_prop_t prop, zprop_source_t *src,
mntopt_on = MNTOPT_NBMAND;
mntopt_off = MNTOPT_NONBMAND;
break;
default:
break;
}
/*
+8 -1
View File
@@ -178,6 +178,8 @@ char *
zpool_state_to_name(vdev_state_t state, vdev_aux_t aux)
{
switch (state) {
default:
break;
case VDEV_STATE_CLOSED:
case VDEV_STATE_OFFLINE:
return (gettext("OFFLINE"));
@@ -421,6 +423,8 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname,
* Perform additional checking for specific properties.
*/
switch (prop) {
default:
break;
case ZPOOL_PROP_VERSION:
if (intval < version || intval > SPA_VERSION) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
@@ -730,7 +734,10 @@ zpool_name_valid(libzfs_handle_t *hdl, boolean_t isopen, const char *pool)
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"multiple '@' delimiters in name"));
break;
case NAME_ERR_NO_AT:
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"permission set is missing '@'"));
break;
}
}
return (B_FALSE);