Author: pjd Date: Tue Sep 14 11:42:07 2010 New Revision: 212609 URL: http://svn.freebsd.org/changeset/base/212609
Log: Simplify the code a bit. Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Tue Sep 14 11:36:26 2010 (r212608) +++ head/sys/geom/part/g_part.c Tue Sep 14 11:42:07 2010 (r212609) @@ -297,17 +297,14 @@ g_part_new_provider(struct g_geom *gp, s } static int -g_part_parm_geom(const char *rawname, struct g_geom **v) +g_part_parm_geom(const char *name, struct g_geom **v) { struct g_geom *gp; - const char *pname; - if (strncmp(rawname, _PATH_DEV, strlen(_PATH_DEV)) == 0) - pname = rawname + strlen(_PATH_DEV); - else - pname = rawname; + if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) + name += strlen(_PATH_DEV); LIST_FOREACH(gp, &g_part_class.geom, geom) { - if (!strcmp(pname, gp->name)) + if (!strcmp(name, gp->name)) break; } if (gp == NULL) @@ -317,14 +314,13 @@ g_part_parm_geom(const char *rawname, st } static int -g_part_parm_provider(const char *pname, struct g_provider **v) +g_part_parm_provider(const char *name, struct g_provider **v) { struct g_provider *pp; - if (strncmp(pname, _PATH_DEV, strlen(_PATH_DEV)) == 0) - pp = g_provider_by_name(pname + strlen(_PATH_DEV)); - else - pp = g_provider_by_name(pname); + if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) + name += strlen(_PATH_DEV); + pp = g_provider_by_name(name); if (pp == NULL) return (EINVAL); *v = pp; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"