Module Name: src
Committed By: dyoung
Date: Thu Apr 30 20:39:08 UTC 2009
Modified Files:
src/sys/kern: kern_drvctl.c
Log Message:
Remove extraneous parentheses. Fix spelling/grammar. No functional
change intended.
To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/kern/kern_drvctl.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/kern_drvctl.c
diff -u src/sys/kern/kern_drvctl.c:1.27 src/sys/kern/kern_drvctl.c:1.28
--- src/sys/kern/kern_drvctl.c:1.27 Thu Apr 30 05:15:36 2009
+++ src/sys/kern/kern_drvctl.c Thu Apr 30 20:39:08 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_drvctl.c,v 1.27 2009/04/30 05:15:36 nonaka Exp $ */
+/* $NetBSD: kern_drvctl.c,v 1.28 2009/04/30 20:39:08 dyoung Exp $ */
/*
* Copyright (c) 2004
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_drvctl.c,v 1.27 2009/04/30 05:15:36 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_drvctl.c,v 1.28 2009/04/30 20:39:08 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -159,7 +159,7 @@
ret = fd_allocfile(&fp, &fd);
if (ret)
- return (ret);
+ return ret;
/* XXX setup context */
mutex_enter(&drvctl_lock);
@@ -239,12 +239,12 @@
* If the parent cannot be notified, it might keep
* pointers to the detached device.
* There might be a private notification mechanism,
- * but better play save here.
+ * but better play it safe here.
*/
if (d->dv_parent && !d->dv_parent->dv_cfattach->ca_childdetached)
- return (ENOTSUP);
+ return ENOTSUP;
#endif
- return (config_detach(d, 0));
+ return config_detach(d, 0);
}
static int
@@ -273,12 +273,12 @@
*/
if (!d->dv_cfattach->ca_rescan ||
!d->dv_cfdriver->cd_attrs)
- return (ENODEV);
+ return ENODEV;
/* allow to omit attribute if there is exactly one */
if (!ifattr) {
if (d->dv_cfdriver->cd_attrs[1])
- return (EINVAL);
+ return EINVAL;
ifattr = d->dv_cfdriver->cd_attrs[0]->ci_name;
} else {
/* check for valid attribute passed */
@@ -286,7 +286,7 @@
if (!strcmp((*ap)->ci_name, ifattr))
break;
if (!*ap)
- return (EINVAL);
+ return EINVAL;
}
rc = (*d->dv_cfattach->ca_rescan)(d, ifattr, locs);
@@ -298,14 +298,14 @@
drvctl_read(struct file *fp, off_t *offp, struct uio *uio, kauth_cred_t cred,
int flags)
{
- return (ENODEV);
+ return ENODEV;
}
static int
drvctl_write(struct file *fp, off_t *offp, struct uio *uio, kauth_cred_t cred,
int flags)
{
- return (ENODEV);
+ return ENODEV;
}
static int
@@ -344,13 +344,13 @@
if (d->numlocators) {
if (d->numlocators > MAXLOCATORS)
- return (EINVAL);
+ return EINVAL;
locs_sz = d->numlocators * sizeof(int);
locs = kmem_alloc(locs_sz, KM_SLEEP);
res = copyin(d->locators, locs, locs_sz);
if (res) {
kmem_free(locs, locs_sz);
- return (res);
+ return res;
}
} else
locs = NULL;
@@ -368,9 +368,9 @@
fp->f_flag);
break;
default:
- return (EPASSTHROUGH);
+ return EPASSTHROUGH;
}
- return (res);
+ return res;
}
static int
@@ -416,7 +416,7 @@
}
mutex_exit(&drvctl_lock);
- return (0);
+ return 0;
}
void
@@ -440,11 +440,11 @@
args_dict = prop_dictionary_get(command_dict, "drvctl-arguments");
if (args_dict == NULL)
- return (EINVAL);
+ return EINVAL;
devname_string = prop_dictionary_get(args_dict, "device-name");
if (devname_string == NULL)
- return (EINVAL);
+ return EINVAL;
for (dev = deviter_first(&di, 0); dev != NULL;
dev = deviter_next(&di)) {
@@ -459,9 +459,9 @@
deviter_release(&di);
if (dev == NULL)
- return (ESRCH);
+ return ESRCH;
- return (0);
+ return 0;
}
struct drvctl_command_desc {
@@ -492,12 +492,12 @@
error = prop_dictionary_copyin_ioctl(pref, ioctl_cmd, &command_dict);
if (error)
- return (error);
+ return error;
results_dict = prop_dictionary_create();
if (results_dict == NULL) {
prop_object_release(command_dict);
- return (ENOMEM);
+ return ENOMEM;
}
command_string = prop_dictionary_get(command_dict, "drvctl-command");
@@ -530,7 +530,7 @@
out:
prop_object_release(command_dict);
prop_object_release(results_dict);
- return (error);
+ return error;
}
static int
@@ -541,19 +541,19 @@
int ret;
if ((fflag & (FREAD|FWRITE)) != (FREAD|FWRITE))
- return (EPERM);
+ return EPERM;
mutex_enter(&drvctl_lock);
while ((dce = TAILQ_FIRST(&drvctl_eventq)) == NULL) {
if (fflag & O_NONBLOCK) {
mutex_exit(&drvctl_lock);
- return (EWOULDBLOCK);
+ return EWOULDBLOCK;
}
ret = cv_wait_sig(&drvctl_cond, &drvctl_lock);
if (ret) {
mutex_exit(&drvctl_lock);
- return (ret);
+ return ret;
}
}
TAILQ_REMOVE(&drvctl_eventq, dce, dce_link);
@@ -566,5 +566,5 @@
prop_object_release(dce->dce_event);
kmem_free(dce, sizeof(*dce));
- return (ret);
+ return ret;
}