]> granicus.if.org Git - zfs/commitdiff
Minor style cleanup
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 17 Jul 2019 00:22:31 +0000 (17:22 -0700)
committerGitHub <noreply@github.com>
Wed, 17 Jul 2019 00:22:31 +0000 (17:22 -0700)
Resolve an assortment of style inconsistencies including
use of white space, typos, capitalization, and line wrapping.
There is no functional change.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #9030

config/kernel-fpu.m4
include/linux/simd_aarch64.h
include/linux/simd_x86.h
module/icp/algs/aes/aes_impl.c
module/icp/algs/modes/gcm.c
module/icp/include/aes/aes_impl.h
module/icp/include/modes/gcm_impl.h
module/spl/spl-thread.c
module/zcommon/zfs_fletcher.c

index 31bf35f837ed74f577bc523447f42cff6a1c23b1..0e622e859e6b04494d0fcadb5d1572b9b0291f2d 100644 (file)
@@ -25,7 +25,8 @@ AC_DEFUN([ZFS_AC_KERNEL_FPU], [
                #include <asm/fpu/api.h>
        ],[
        ],[
-               AC_DEFINE(HAVE_KERNEL_FPU_API_HEADER, 1, [kernel has asm/fpu/api.h])
+               AC_DEFINE(HAVE_KERNEL_FPU_API_HEADER, 1,
+                   [kernel has asm/fpu/api.h])
                AC_MSG_RESULT(asm/fpu/api.h)
        ],[
                AC_MSG_RESULT(i387.h & xcr.h)
@@ -46,8 +47,10 @@ AC_DEFUN([ZFS_AC_KERNEL_FPU], [
                kernel_fpu_end();
        ], [kernel_fpu_begin], [arch/x86/kernel/fpu/core.c], [
                AC_MSG_RESULT(kernel_fpu_*)
-               AC_DEFINE(HAVE_KERNEL_FPU, 1, [kernel has kernel_fpu_* functions])
-               AC_DEFINE(KERNEL_EXPORTS_X86_FPU, 1, [kernel exports FPU functions])
+               AC_DEFINE(HAVE_KERNEL_FPU, 1,
+                   [kernel has kernel_fpu_* functions])
+               AC_DEFINE(KERNEL_EXPORTS_X86_FPU, 1,
+                   [kernel exports FPU functions])
        ],[
                ZFS_LINUX_TRY_COMPILE_SYMBOL([
                        #include <linux/module.h>
index 1cfcd01e45eaf812a2b39bf95e6022faf635bc8d..b45d31c48167105df1c2943cc89708f221ee594b 100644 (file)
  * USER API:
  *
  * Kernel fpu methods:
- *     kfpu_begin()
- *     kfpu_end()
+ *     kfpu_allowed()
+ *     kfpu_initialize()
+ *     kfpu_begin()
+ *     kfpu_end()
  */
 
 #ifndef _SIMD_AARCH64_H
index 2d7a1c3a5209ed1864b5a619ff09c9531cea2991..641f439552e76292a863f5e93de17e69c8adcb76 100644 (file)
  * USER API:
  *
  * Kernel fpu methods:
- *     kfpu_begin()
- *     kfpu_end()
+ *     kfpu_allowed()
+ *     kfpu_initialize()
+ *     kfpu_begin()
+ *     kfpu_end()
  *
  * SIMD support:
  *
  * all relevant feature test functions should be called.
  *
  * Supported features:
- *     zfs_sse_available()
- *     zfs_sse2_available()
- *     zfs_sse3_available()
- *     zfs_ssse3_available()
- *     zfs_sse4_1_available()
- *     zfs_sse4_2_available()
+ *     zfs_sse_available()
+ *     zfs_sse2_available()
+ *     zfs_sse3_available()
+ *     zfs_ssse3_available()
+ *     zfs_sse4_1_available()
+ *     zfs_sse4_2_available()
  *
- *     zfs_avx_available()
- *     zfs_avx2_available()
+ *     zfs_avx_available()
+ *     zfs_avx2_available()
  *
- *     zfs_bmi1_available()
- *     zfs_bmi2_available()
+ *     zfs_bmi1_available()
+ *     zfs_bmi2_available()
  *
- *     zfs_avx512f_available()
- *     zfs_avx512cd_available()
- *     zfs_avx512er_available()
- *     zfs_avx512pf_available()
- *     zfs_avx512bw_available()
- *     zfs_avx512dq_available()
- *     zfs_avx512vl_available()
- *     zfs_avx512ifma_available()
- *     zfs_avx512vbmi_available()
+ *     zfs_avx512f_available()
+ *     zfs_avx512cd_available()
+ *     zfs_avx512er_available()
+ *     zfs_avx512pf_available()
+ *     zfs_avx512bw_available()
+ *     zfs_avx512dq_available()
+ *     zfs_avx512vl_available()
+ *     zfs_avx512ifma_available()
+ *     zfs_avx512vbmi_available()
  *
  * NOTE(AVX-512VL):    If using AVX-512 instructions with 128Bit registers
- *                     also add zfs_avx512vl_available() to feature check.
+ *                     also add zfs_avx512vl_available() to feature check.
  */
 
 #ifndef _SIMD_X86_H
@@ -292,7 +294,7 @@ typedef struct cpuid_feature_desc {
  * Descriptions of supported instruction sets
  */
 static const cpuid_feature_desc_t cpuid_features[] = {
-       [SSE]           = {1U, 0U,      1U << 25,       EDX     },
+       [SSE]           = {1U, 0U,      1U << 25,       EDX     },
        [SSE2]          = {1U, 0U,      1U << 26,       EDX     },
        [SSE3]          = {1U, 0U,      1U << 0,        ECX     },
        [SSSE3]         = {1U, 0U,      1U << 9,        ECX     },
index 457b9e45c662e0a5a3e7d8e6d6a7e927996c8a9d..0f11f9999ff9181ca4b8f988bccd648aa9e3a774 100644 (file)
@@ -311,16 +311,21 @@ aes_impl_init(void *arg)
        }
        aes_supp_impl_cnt = c;
 
-       /* set fastest implementation. assume hardware accelerated is fastest */
+       /*
+        * Set the fastest implementation given the assumption that the
+        * hardware accelerated version is the fastest.
+        */
 #if defined(__x86_64)
 #if defined(HAVE_AES)
-       if (aes_aesni_impl.is_supported())
+       if (aes_aesni_impl.is_supported()) {
                memcpy(&aes_fastest_impl, &aes_aesni_impl,
                    sizeof (aes_fastest_impl));
-       else
+       else
 #endif
+       {
                memcpy(&aes_fastest_impl, &aes_x86_64_impl,
                    sizeof (aes_fastest_impl));
+       }
 #else
        memcpy(&aes_fastest_impl, &aes_generic_impl,
            sizeof (aes_fastest_impl));
index f6f8434de772c5c939152676d19ad7cd161f1d37..423b70e2c86b6573ade37d02421adaf7c7ee029f 100644 (file)
@@ -647,7 +647,7 @@ const gcm_impl_ops_t *gcm_all_impl[] = {
 /* Indicate that benchmark has been completed */
 static boolean_t gcm_impl_initialized = B_FALSE;
 
-/* Select aes implementation */
+/* Select GCM implementation */
 #define        IMPL_FASTEST    (UINT32_MAX)
 #define        IMPL_CYCLE      (UINT32_MAX-1)
 
@@ -724,13 +724,15 @@ gcm_impl_init(void *arg)
         * hardware accelerated version is the fastest.
         */
 #if defined(__x86_64) && defined(HAVE_PCLMULQDQ)
-       if (gcm_pclmulqdq_impl.is_supported())
+       if (gcm_pclmulqdq_impl.is_supported()) {
                memcpy(&gcm_fastest_impl, &gcm_pclmulqdq_impl,
                    sizeof (gcm_fastest_impl));
-       else
+       else
 #endif
+       {
                memcpy(&gcm_fastest_impl, &gcm_generic_impl,
                    sizeof (gcm_fastest_impl));
+       }
 
        strcpy(gcm_fastest_impl.name, "fastest");
 
@@ -753,7 +755,7 @@ static const struct {
  * If we are called before init(), user preference will be saved in
  * user_sel_impl, and applied in later init() call. This occurs when module
  * parameter is specified on module load. Otherwise, directly update
- * icp_aes_impl.
+ * icp_gcm_impl.
  *
  * @val                Name of gcm implementation to use
  * @param      Unused.
index 9fd9c1bd1a9a6b54edf4408976c79612c66b6ef4..329e32a8e661385cd467c1b541ab4077d2dea94d 100644 (file)
@@ -162,7 +162,7 @@ typedef enum aes_mech_type {
 #endif /* _AES_IMPL */
 
 /*
- * Methods used to define aes implementation
+ * Methods used to define AES implementation
  *
  * @aes_gen_f Key generation
  * @aes_enc_f Function encrypts one block
index 1380904873ab4fe0382fdf225dbb7ab9813f98ce..dff372ef8ba2ce24b1fb1d8691debe71c16e82b4 100644 (file)
@@ -37,12 +37,12 @@ extern "C" {
 #include <sys/crypto/common.h>
 
 /*
- * Methods used to define gcm implementation
+ * Methods used to define GCM implementation
  *
  * @gcm_mul_f Perform carry-less multiplication
  * @gcm_will_work_f Function tests whether implementation will function
  */
-typedef void           (*gcm_mul_f)(uint64_t *, uint64_t *, uint64_t *);
+typedef void           (*gcm_mul_f)(uint64_t *, uint64_t *, uint64_t *);
 typedef boolean_t      (*gcm_will_work_f)(void);
 
 #define        GCM_IMPL_NAME_MAX (16)
index c4977bcf26cf131ccaa795db8d890a6aeeee3874..07e3a1bfff297f38a8ca488fbfcb153233e3b41c 100644 (file)
@@ -155,8 +155,9 @@ spl_kthread_create(int (*func)(void *), void *data, const char namefmt[], ...)
                        if (PTR_ERR(tsk) == -ENOMEM)
                                continue;
                        return (NULL);
-               } else
+               } else {
                        return (tsk);
+               }
        } while (1);
 }
 EXPORT_SYMBOL(spl_kthread_create);
index b75d8ab003b06aa1bdbf20c671dd1d4dc5e41407..9187a7c1ed5f27bc69fff5aa2b5c8095a46aaa6d 100644 (file)
@@ -595,8 +595,9 @@ fletcher_4_incremental_byteswap(void *buf, size_t size, void *data)
 }
 
 #if defined(_KERNEL)
-/* Fletcher 4 kstats */
-
+/*
+ * Fletcher 4 kstats
+ */
 static int
 fletcher_4_kstat_headers(char *buf, size_t size)
 {
@@ -673,7 +674,6 @@ fletcher_4_benchmark_impl(boolean_t native, char *data, uint64_t data_size)
        zio_cksum_t zc;
        uint32_t i, l, sel_save = IMPL_READ(fletcher_4_impl_chosen);
 
-
        fletcher_checksum_func_t *fletcher_4_test = native ?
            fletcher_4_native : fletcher_4_byteswap;