]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Fix icp build on FreeBSD
authorMatthew Macy <mmacy@freebsd.org>
Fri, 1 Nov 2019 17:27:53 +0000 (10:27 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 1 Nov 2019 17:27:53 +0000 (10:27 -0700)
- ROTATE_LEFT is not used by amd64, move it down within
  the scope it's used to silence a clang warning.

- __unused is an alias for the compiler annotation
  __attribute__((__unused__)) on FreeBSD.  Rename the
  field to ____unused.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #9538

module/icp/algs/sha1/sha1.c
module/icp/include/sys/modctl.h

index 7f28b3796b5d5c01aed99c81f2c45d5c85467de4..e4b7a0c8c0e5a5d82baf28e37da3cc31b1dfadbd 100644 (file)
@@ -80,28 +80,6 @@ static uint8_t PADDING[64] = { 0x80, /* all zeros */ };
 #define        G(b, c, d)      ((b) ^ (c) ^ (d))
 #define        H(b, c, d)      (((b) & (c)) | (((b)|(c)) & (d)))
 
-/*
- * ROTATE_LEFT rotates x left n bits.
- */
-
-#if    defined(__GNUC__) && defined(_LP64)
-static __inline__ uint64_t
-ROTATE_LEFT(uint64_t value, uint32_t n)
-{
-       uint32_t t32;
-
-       t32 = (uint32_t)value;
-       return ((t32 << n) | (t32 >> (32 - n)));
-}
-
-#else
-
-#define        ROTATE_LEFT(x, n)       \
-       (((x) << (n)) | ((x) >> ((sizeof (x) * NBBY)-(n))))
-
-#endif
-
-
 /*
  * SHA1Init()
  *
@@ -269,6 +247,27 @@ typedef uint32_t sha1word;
 #define        W(n) w_ ## n
 #endif /* !defined(W_ARRAY) */
 
+/*
+ * ROTATE_LEFT rotates x left n bits.
+ */
+
+#if    defined(__GNUC__) && defined(_LP64)
+static __inline__ uint64_t
+ROTATE_LEFT(uint64_t value, uint32_t n)
+{
+       uint32_t t32;
+
+       t32 = (uint32_t)value;
+       return ((t32 << n) | (t32 >> (32 - n)));
+}
+
+#else
+
+#define        ROTATE_LEFT(x, n)       \
+       (((x) << (n)) | ((x) >> ((sizeof (x) * NBBY)-(n))))
+
+#endif
+
 #if    defined(__sparc)
 
 
index a0b94ef39db8da427031c99cf07eaa6dfd45ddd9..6c26ad618c9398bd947064b64898b1b9a61ae761 100644 (file)
@@ -398,7 +398,7 @@ typedef struct modctl {
        char            mod_delay_unload;       /* deferred unload */
 
        struct modctl_list *mod_requisites;     /* mods this one depends on. */
-       void            *__unused;      /* NOTE: reuse (same size) is OK, */
+       void            *____unused;    /* NOTE: reuse (same size) is OK, */
                                        /* deletion causes mdb.vs.core issues */
        int             mod_loadcnt;    /* number of times mod was loaded */
        int             mod_nenabled;   /* # of enabled DTrace probes in mod */