summaryrefslogtreecommitdiffstats
path: root/module/zcommon
diff options
context:
space:
mode:
authorMichael Kjorling <[email protected]>2013-11-01 20:26:11 +0100
committerBrian Behlendorf <[email protected]>2013-12-18 16:46:35 -0800
commitd1d7e2689db9e03f11c069ebc9f1ba12829e5dac (patch)
tree75b9a2b23334d5f673fb31f142f74146d351865c /module/zcommon
parent8ffef572ed2ba97e0c2d6a8aa2240012e611dc6f (diff)
cstyle: Resolve C style issues
The vast majority of these changes are in Linux specific code. They are the result of not having an automated style checker to validate the code when it was originally written. Others were caused when the common code was slightly adjusted for Linux. This patch contains no functional changes. It only refreshes the code to conform to style guide. Everyone submitting patches for inclusion upstream should now run 'make checkstyle' and resolve any warning prior to opening a pull request. The automated builders have been updated to fail a build if when 'make checkstyle' detects an issue. Signed-off-by: Brian Behlendorf <[email protected]> Closes #1821
Diffstat (limited to 'module/zcommon')
-rw-r--r--module/zcommon/zfs_uio.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/module/zcommon/zfs_uio.c b/module/zcommon/zfs_uio.c
index 990464594..90376f2ac 100644
--- a/module/zcommon/zfs_uio.c
+++ b/module/zcommon/zfs_uio.c
@@ -70,19 +70,16 @@ uiomove(void *p, size_t n, enum uio_rw rw, struct uio *uio)
switch (uio->uio_segflg) {
case UIO_USERSPACE:
case UIO_USERISPACE:
- /* p = kernel data pointer
- * iov->iov_base = user data pointer */
-
+ /*
+ * p = kernel data pointer
+ * iov->iov_base = user data pointer
+ */
if (rw == UIO_READ) {
if (copy_to_user(iov->iov_base, p, cnt))
- return EFAULT;
- /* error = xcopyout_nta(p, iov->iov_base, cnt,
- * (uio->uio_extflg & UIO_COPY_CACHED)); */
+ return (EFAULT);
} else {
- /* error = xcopyin_nta(iov->iov_base, p, cnt,
- * (uio->uio_extflg & UIO_COPY_CACHED)); */
if (copy_from_user(p, iov->iov_base, cnt))
- return EFAULT;
+ return (EFAULT);
}
break;
case UIO_SYSSPACE:
@@ -103,7 +100,7 @@ uiomove(void *p, size_t n, enum uio_rw rw, struct uio *uio)
}
EXPORT_SYMBOL(uiomove);
-#define fuword8(uptr, vptr) get_user((*vptr), (uptr))
+#define fuword8(uptr, vptr) get_user((*vptr), (uptr))
/*
* Fault in the pages of the first n bytes specified by the uio structure.
@@ -194,21 +191,18 @@ uiocopy(void *p, size_t n, enum uio_rw rw, struct uio *uio, size_t *cbytes)
case UIO_USERSPACE:
case UIO_USERISPACE:
- /* p = kernel data pointer
- * iov->iov_base = user data pointer */
-
+ /*
+ * p = kernel data pointer
+ * iov->iov_base = user data pointer
+ */
if (rw == UIO_READ) {
- /* * UIO_READ = copy data from kernel to user * */
+ /* UIO_READ = copy data from kernel to user */
if (copy_to_user(iov->iov_base, p, cnt))
- return EFAULT;
- /* error = xcopyout_nta(p, iov->iov_base, cnt,
- * (uio->uio_extflg & UIO_COPY_CACHED)); */
+ return (EFAULT);
} else {
- /* * UIO_WRITE = copy data from user to kernel * */
- /* error = xcopyin_nta(iov->iov_base, p, cnt,
- * (uio->uio_extflg & UIO_COPY_CACHED)); */
+ /* UIO_WRITE = copy data from user to kernel */
if (copy_from_user(p, iov->iov_base, cnt))
- return EFAULT;
+ return (EFAULT);
}
break;