[PATCH] lib: dynamic_queue_limits: Fix when built in ARCH nds32

From: Yejune Deng
Date: Fri Jan 15 2021 - 20:02:45 EST


In arch nds32, build fail with following errors:
lib/dynamic_queue_limits.c: In function 'dql_reset':
lib/dynamic_queue_limits.c:119:2: error: implicit declaration of
function 'memset' [-Werror=implicit-function-declaration]
memset(dql, 0, offsetof(struct dql, lowest_slack));

Add <linux/string.h> fixes that.

Fixes: 36ef65b21930 ("lib: dynamic_queue_limits: use memset and offsetof ")
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Signed-off-by: Yejune Deng <yejune.deng@xxxxxxxxx>
---
lib/dynamic_queue_limits.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/lib/dynamic_queue_limits.c b/lib/dynamic_queue_limits.c
index 21f07452a6f7..334ac16a1bfc 100644
--- a/lib/dynamic_queue_limits.c
+++ b/lib/dynamic_queue_limits.c
@@ -10,6 +10,7 @@
#include <linux/dynamic_queue_limits.h>
#include <linux/compiler.h>
#include <linux/export.h>
+#include <linux/string.h>

#define POSDIFF(A, B) ((int)((A) - (B)) > 0 ? (A) - (B) : 0)
#define AFTER_EQ(A, B) ((int)((A) - (B)) >= 0)
--
2.29.0