fix: include byteorder.h for 'cpu_to_*'
[lttng-modules.git] / src / lib / msgpack / msgpack.c
index 0803bc657646b49f4dcbc7c3ffad244a0ec33a44..16658d11b7843aaebe995126367e05d88ad8edd5 100644 (file)
@@ -55,6 +55,7 @@
 #include <linux/bug.h>
 #include <linux/string.h>
 #include <linux/types.h>
+#include <asm/byteorder.h>
 
 #include <lttng/msgpack.h>
 
@@ -316,7 +317,7 @@ int lttng_msgpack_begin_map(struct lttng_msgpack_writer *writer, size_t count)
 {
        int ret;
 
-       if (count < 0 || count >= (1 << 16)) {
+       if (count >= (1 << 16)) {
                ret = -1;
                goto end;
        }
@@ -343,7 +344,7 @@ int lttng_msgpack_begin_array(
 {
        int ret;
 
-       if (count < 0 || count >= (1 << 16)) {
+       if (count >= (1 << 16)) {
                ret = -1;
                goto end;
        }
@@ -370,7 +371,8 @@ int lttng_msgpack_write_str(struct lttng_msgpack_writer *writer,
 {
        int ret;
        size_t length = strlen(str);
-       if (length < 0 || length >= (1 << 16)) {
+
+       if (length >= (1 << 16)) {
                ret = -1;
                goto end;
        }
This page took 0.023238 seconds and 4 git commands to generate.