stand/ofw: Use strpbrk instead of two strchrs
No need to call strchr twice, when one call to strpbrk will do the job.. Test booted with qemu-powerpc + mac99 successfully. Minor style(9) tweaks as well. Sponsored by: Netflix
This commit is contained in:
parent
bc9a5b0497
commit
b60164c9f4
@ -47,13 +47,10 @@ ofw_getdev(void **vdev, const char *devspec, const char **path)
|
||||
int rv;
|
||||
|
||||
/*
|
||||
* If it looks like this is just a path and no
|
||||
* device, go with the current device.
|
||||
* If it looks like this is just a path and no device, go with the current
|
||||
* device.
|
||||
*/
|
||||
if ((devspec == NULL) ||
|
||||
((strchr(devspec, '@') == NULL) &&
|
||||
(strchr(devspec, ':') == NULL))) {
|
||||
|
||||
if (devspec == NULL || strpbrk(devspec, ":@") == NULL) {
|
||||
if (((rv = ofw_parsedev(dev, getenv("currdev"), NULL)) == 0) &&
|
||||
(path != NULL))
|
||||
*path = devspec;
|
||||
|
Loading…
Reference in New Issue
Block a user