loader: cstyle cleanup of userboot/devicename.c
No functional changes intended. MFC after: 1 week
This commit is contained in:
parent
bed2ac27a1
commit
5d5a621664
@ -38,7 +38,8 @@ __FBSDID("$FreeBSD$");
|
||||
#include "libzfs.h"
|
||||
#endif
|
||||
|
||||
static int userboot_parsedev(struct disk_devdesc **dev, const char *devspec, const char **path);
|
||||
static int userboot_parsedev(struct disk_devdesc **dev, const char *devspec,
|
||||
const char **path);
|
||||
|
||||
/*
|
||||
* Point (dev) at an allocated device specifier for the device matching the
|
||||
@ -59,8 +60,8 @@ userboot_getdev(void **vdev, const char *devspec, const char **path)
|
||||
(devspec[0] == '/') ||
|
||||
(strchr(devspec, ':') == NULL)) {
|
||||
|
||||
if (((rv = userboot_parsedev(dev, getenv("currdev"), NULL)) == 0) &&
|
||||
(path != NULL))
|
||||
rv = userboot_parsedev(dev, getenv("currdev"), NULL);
|
||||
if (rv == 0 && path != NULL)
|
||||
*path = devspec;
|
||||
return (rv);
|
||||
}
|
||||
@ -86,7 +87,8 @@ userboot_getdev(void **vdev, const char *devspec, const char **path)
|
||||
*
|
||||
*/
|
||||
static int
|
||||
userboot_parsedev(struct disk_devdesc **dev, const char *devspec, const char **path)
|
||||
userboot_parsedev(struct disk_devdesc **dev, const char *devspec,
|
||||
const char **path)
|
||||
{
|
||||
struct disk_devdesc *idev;
|
||||
struct devsw *dv;
|
||||
@ -100,7 +102,8 @@ userboot_parsedev(struct disk_devdesc **dev, const char *devspec, const char **p
|
||||
|
||||
/* look for a device that matches */
|
||||
for (i = 0, dv = NULL; devsw[i] != NULL; i++) {
|
||||
if (!strncmp(devspec, devsw[i]->dv_name, strlen(devsw[i]->dv_name))) {
|
||||
if (strncmp(devspec, devsw[i]->dv_name,
|
||||
strlen(devsw[i]->dv_name)) == 0) {
|
||||
dv = devsw[i];
|
||||
break;
|
||||
}
|
||||
@ -126,7 +129,8 @@ userboot_parsedev(struct disk_devdesc **dev, const char *devspec, const char **p
|
||||
unit = 0;
|
||||
|
||||
if (*np && (*np != ':')) {
|
||||
unit = strtol(np, (char **)&cp, 0); /* get unit number if present */
|
||||
/* get unit number if present */
|
||||
unit = strtol(np, (char **)&cp, 0);
|
||||
if (cp == np) {
|
||||
err = EUNIT;
|
||||
goto fail;
|
||||
|
Loading…
Reference in New Issue
Block a user