From: Olaf Faaland Date: Thu, 5 Oct 2017 16:42:20 +0000 (-0400) Subject: Make include/linux/ conform to ZFS style standard X-Git-Url: https://git.proxmox.com/?p=mirror_spl.git;a=commitdiff_plain;h=ce319db57b1662a21d60550e546592c96c3da7a1 Make include/linux/ conform to ZFS style standard No semantic changes. Fix the following types of style issues: blank after preprocessor # #define followed by space instead of tab improper first line of block comment indent by spaces instead of tabs last line in file is blank missing blank after open comment missing space before left brace non-continuation indented 4 spaces spaces instead of tabs unparenthesized return expression Signed-off-by: Olaf Faaland --- diff --git a/include/linux/bitops_compat.h b/include/linux/bitops_compat.h index dc7ed86..a62b628 100644 --- a/include/linux/bitops_compat.h +++ b/include/linux/bitops_compat.h @@ -23,9 +23,8 @@ */ #ifndef _SPL_BITOPS_COMPAT_H -#define _SPL_BITOPS_COMPAT_H +#define _SPL_BITOPS_COMPAT_H #include #endif /* _SPL_BITOPS_COMPAT_H */ - diff --git a/include/linux/compiler_compat.h b/include/linux/compiler_compat.h index 06268bf..696d795 100644 --- a/include/linux/compiler_compat.h +++ b/include/linux/compiler_compat.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_COMPILER_COMPAT_H -#define _SPL_COMPILER_COMPAT_H +#define _SPL_COMPILER_COMPAT_H #include @@ -41,7 +41,7 @@ * handlers, all running on the same CPU. */ /* Taken from 2.6.33.2 */ -# define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) +#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) #endif #endif /* _SPL_COMPILER_COMPAT_H */ diff --git a/include/linux/delay_compat.h b/include/linux/delay_compat.h index 0c91a24..c7a3811 100644 --- a/include/linux/delay_compat.h +++ b/include/linux/delay_compat.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_DELAY_COMPAT_H -#define _SPL_DELAY_COMPAT_H +#define _SPL_DELAY_COMPAT_H #include #include diff --git a/include/linux/file_compat.h b/include/linux/file_compat.h index 2629996..7d61ba5 100644 --- a/include/linux/file_compat.h +++ b/include/linux/file_compat.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_FILE_COMPAT_H -#define _SPL_FILE_COMPAT_H +#define _SPL_FILE_COMPAT_H #include #ifdef HAVE_FDTABLE_HEADER @@ -33,22 +33,22 @@ static inline struct file * spl_filp_open(const char *name, int flags, int mode, int *err) { - struct file *filp = NULL; - int rc; + struct file *filp = NULL; + int rc; - filp = filp_open(name, flags, mode); - if (IS_ERR(filp)) { - rc = PTR_ERR(filp); - if (err) - *err = rc; - filp = NULL; - } - return filp; + filp = filp_open(name, flags, mode); + if (IS_ERR(filp)) { + rc = PTR_ERR(filp); + if (err) + *err = rc; + filp = NULL; + } + return (filp); } -#define spl_filp_close(f) filp_close(f, NULL) -#define spl_filp_poff(f) (&(f)->f_pos) -#define spl_filp_write(fp, b, s, p) (fp)->f_op->write((fp), (b), (s), p) +#define spl_filp_close(f) filp_close(f, NULL) +#define spl_filp_poff(f) (&(f)->f_pos) +#define spl_filp_write(fp, b, s, p) (fp)->f_op->write((fp), (b), (s), p) static inline int spl_filp_fallocate(struct file *fp, int mode, loff_t offset, loff_t len) @@ -65,7 +65,7 @@ spl_filp_fallocate(struct file *fp, int mode, loff_t offset, loff_t len) error = fp->f_dentry->d_inode->i_op->fallocate( fp->f_dentry->d_inode, mode, offset, len); #endif /* HAVE_INODE_FALLOCATE */ -#endif /*HAVE_FILE_FALLOCATE */ +#endif /* HAVE_FILE_FALLOCATE */ return (error); } @@ -97,4 +97,3 @@ spl_filp_fallocate(struct file *fp, int mode, loff_t offset, loff_t len) #endif #endif /* SPL_FILE_COMPAT_H */ - diff --git a/include/linux/list_compat.h b/include/linux/list_compat.h index 63e4553..fece8ad 100644 --- a/include/linux/list_compat.h +++ b/include/linux/list_compat.h @@ -23,29 +23,28 @@ */ #ifndef _SPL_LIST_COMPAT_H -#define _SPL_LIST_COMPAT_H +#define _SPL_LIST_COMPAT_H #include #ifndef list_for_each_entry_safe_reverse -/** +/* * list_for_each_entry_safe_reverse - * @pos: the type * to use as a loop cursor. - * @n: another type * to use as temporary storage - * @head: the head for your list. - * @member: the name of the list_struct within the struct. + * @pos: the type * to use as a loop cursor. + * @n: another type * to use as temporary storage + * @head: the head for your list. + * @member: the name of the list_struct within the struct. * * Iterate backwards over list of given type, safe against removal * of list entry. */ -#define list_for_each_entry_safe_reverse(pos, n, head, member) \ - for (pos = list_entry((head)->prev, typeof(*pos), member), \ - n = list_entry(pos->member.prev, typeof(*pos), member); \ - &pos->member != (head); \ - pos = n, n = list_entry(n->member.prev, typeof(*n), member)) +#define list_for_each_entry_safe_reverse(pos, n, head, member) \ + for (pos = list_entry((head)->prev, typeof(*pos), member), \ + n = list_entry(pos->member.prev, typeof(*pos), member); \ + &pos->member != (head); \ + pos = n, n = list_entry(n->member.prev, typeof(*n), member)) #endif /* list_for_each_entry_safe_reverse */ #endif /* SPL_LIST_COMPAT_H */ - diff --git a/include/linux/math64_compat.h b/include/linux/math64_compat.h index 83046a0..e45015b 100644 --- a/include/linux/math64_compat.h +++ b/include/linux/math64_compat.h @@ -23,10 +23,10 @@ */ #ifndef _SPL_MATH64_COMPAT_H -#define _SPL_MATH64_COMPAT_H +#define _SPL_MATH64_COMPAT_H #ifndef abs64 -#define abs64(x) ({ uint64_t t = (x) >> 63; ((x) ^ t) - t; }) +#define abs64(x) ({ uint64_t t = (x) >> 63; ((x) ^ t) - t; }) #endif #endif /* _SPL_MATH64_COMPAT_H */ diff --git a/include/linux/mm_compat.h b/include/linux/mm_compat.h index 6c285bb..c10652e 100644 --- a/include/linux/mm_compat.h +++ b/include/linux/mm_compat.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_MM_COMPAT_H -#define _SPL_MM_COMPAT_H +#define _SPL_MM_COMPAT_H #include #include diff --git a/include/linux/proc_compat.h b/include/linux/proc_compat.h index 3ec66af..91d914e 100644 --- a/include/linux/proc_compat.h +++ b/include/linux/proc_compat.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_PROC_COMPAT_H -#define _SPL_PROC_COMPAT_H +#define _SPL_PROC_COMPAT_H #include diff --git a/include/linux/rwsem_compat.h b/include/linux/rwsem_compat.h index c2f22b0..7a0dcf8 100644 --- a/include/linux/rwsem_compat.h +++ b/include/linux/rwsem_compat.h @@ -23,7 +23,7 @@ */ #ifndef _SPL_RWSEM_COMPAT_H -#define _SPL_RWSEM_COMPAT_H +#define _SPL_RWSEM_COMPAT_H #include @@ -53,15 +53,16 @@ int rwsem_tryupgrade(struct rw_semaphore *rwsem); #if defined(RWSEM_SPINLOCK_IS_RAW) -#define spl_rwsem_lock_irqsave(lk, fl) raw_spin_lock_irqsave(lk, fl) -#define spl_rwsem_unlock_irqrestore(lk, fl) raw_spin_unlock_irqrestore(lk, fl) -#define spl_rwsem_trylock_irqsave(lk, fl) raw_spin_trylock_irqsave(lk, fl) +#define spl_rwsem_lock_irqsave(lk, fl) raw_spin_lock_irqsave(lk, fl) +#define spl_rwsem_unlock_irqrestore(lk, fl) \ + raw_spin_unlock_irqrestore(lk, fl) +#define spl_rwsem_trylock_irqsave(lk, fl) raw_spin_trylock_irqsave(lk, fl) #else -#define spl_rwsem_lock_irqsave(lk, fl) spin_lock_irqsave(lk, fl) -#define spl_rwsem_unlock_irqrestore(lk, fl) spin_unlock_irqrestore(lk, fl) -#define spl_rwsem_trylock_irqsave(lk, fl) spin_trylock_irqsave(lk, fl) +#define spl_rwsem_lock_irqsave(lk, fl) spin_lock_irqsave(lk, fl) +#define spl_rwsem_unlock_irqrestore(lk, fl) spin_unlock_irqrestore(lk, fl) +#define spl_rwsem_trylock_irqsave(lk, fl) spin_trylock_irqsave(lk, fl) #endif /* RWSEM_SPINLOCK_IS_RAW */ -#define spl_rwsem_is_locked(rwsem) rwsem_is_locked(rwsem) +#define spl_rwsem_is_locked(rwsem) rwsem_is_locked(rwsem) #endif /* _SPL_RWSEM_COMPAT_H */ diff --git a/include/linux/wait_compat.h b/include/linux/wait_compat.h index dd0c932..10fe2d8 100644 --- a/include/linux/wait_compat.h +++ b/include/linux/wait_compat.h @@ -23,23 +23,23 @@ */ #ifndef _SPL_WAIT_COMPAT_H -#define _SPL_WAIT_COMPAT_H +#define _SPL_WAIT_COMPAT_H #include #include #ifndef HAVE_WAIT_ON_BIT_ACTION -# define spl_wait_on_bit(word, bit, mode) wait_on_bit(word, bit, mode) +#define spl_wait_on_bit(word, bit, mode) wait_on_bit(word, bit, mode) #else static inline int spl_bit_wait(void *word) { - schedule(); - return 0; + schedule(); + return (0); } -#define spl_wait_on_bit(word, bit, mode) \ +#define spl_wait_on_bit(word, bit, mode) \ wait_on_bit(word, bit, spl_bit_wait, mode) #endif /* HAVE_WAIT_ON_BIT_ACTION */ diff --git a/include/linux/zlib_compat.h b/include/linux/zlib_compat.h index d2fefd1..3c14285 100644 --- a/include/linux/zlib_compat.h +++ b/include/linux/zlib_compat.h @@ -22,15 +22,15 @@ */ #ifndef _SPL_ZLIB_COMPAT_H -#define _SPL_ZLIB_COMPAT_H +#define _SPL_ZLIB_COMPAT_H #include #ifdef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE -#define spl_zlib_deflate_workspacesize(wb, ml) \ +#define spl_zlib_deflate_workspacesize(wb, ml) \ zlib_deflate_workspacesize(wb, ml) #else -#define spl_zlib_deflate_workspacesize(wb, ml) \ +#define spl_zlib_deflate_workspacesize(wb, ml) \ zlib_deflate_workspacesize() #endif /* HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */