]> git.sur5r.net Git - u-boot/blobdiff - lib/bch.c
sunxi: DT: update device tree files for Allwinner H3 and H5 SoCs
[u-boot] / lib / bch.c
index ec53483774b5babe49437fa79537e4d80a91b13c..20079eb9ebd12eb3d38b37f30d515b131f55a383 100644 (file)
--- a/lib/bch.c
+++ b/lib/bch.c
@@ -1,8 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Generic binary BCH encoding/decoding library
  *
- * SPDX-License-Identifier:    GPL-2.0
- *
  * Copyright © 2011 Parrot S.A.
  *
  * Author: Ivan Djelic <ivan.djelic@parrot.com>
 #include <linux/bitops.h>
 #else
 #include <errno.h>
+#if defined(__FreeBSD__)
+#include <sys/endian.h>
+#else
 #include <endian.h>
+#endif
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
@@ -113,6 +116,7 @@ struct gf_poly_deg1 {
 };
 
 #ifdef USE_HOSTCC
+#if !defined(__DragonFly__) && !defined(__FreeBSD__)
 static int fls(int x)
 {
        int r = 32;
@@ -142,6 +146,7 @@ static int fls(int x)
        return r;
 }
 #endif
+#endif
 
 /*
  * same as encode_bch(), but process input data one byte at a time