From 4bbbf5d2e33266344db9cd25d5a5b29791f158ce Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Fri, 3 Jan 2020 15:52:14 +0100 Subject: [PATCH] dde_linux: reduce compiler warnings --- repos/dde_linux/lib/mk/lxip.mk | 2 +- repos/dde_linux/lib/mk/wifi.inc | 1 + repos/dde_linux/patches/lxip_log2.patch | 10 ++++++++++ repos/dde_linux/ports/dde_linux.hash | 2 +- repos/dde_linux/ports/dde_linux.port | 1 + .../src/drivers/framebuffer/intel/include/lx_emul.h | 7 ++----- repos/dde_linux/src/include/lx_emul/bug.h | 2 +- repos/dde_linux/src/lib/lxip/include/lx_emul.h | 10 +++++----- 8 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 repos/dde_linux/patches/lxip_log2.patch diff --git a/repos/dde_linux/lib/mk/lxip.mk b/repos/dde_linux/lib/mk/lxip.mk index 371266c73..b457926e4 100644 --- a/repos/dde_linux/lib/mk/lxip.mk +++ b/repos/dde_linux/lib/mk/lxip.mk @@ -17,7 +17,7 @@ CC_OPT += -DCONFIG_INET -DCONFIG_BASE_SMALL=0 -DCONFIG_DEBUG_LOCK_ALLOC \ CC_WARN = -Wall -Wno-unused-variable -Wno-uninitialized \ -Wno-unused-function -Wno-overflow -Wno-pointer-arith \ - -Wno-sign-compare + -Wno-sign-compare -Wno-builtin-declaration-mismatch CC_C_OPT += -std=gnu89 CC_C_OPT += -Wno-unused-but-set-variable -Wno-pointer-sign diff --git a/repos/dde_linux/lib/mk/wifi.inc b/repos/dde_linux/lib/mk/wifi.inc index 28a56c534..dddb2a80f 100644 --- a/repos/dde_linux/lib/mk/wifi.inc +++ b/repos/dde_linux/lib/mk/wifi.inc @@ -31,6 +31,7 @@ CC_C_OPT += -std=gnu89 CC_C_OPT += -include $(LIB_INC_DIR)/lx_emul.h CC_C_OPT += -Wall -Wno-unused-variable -Wno-unused-function -Wno-uninitialized CC_C_OPT += -Wno-unused-but-set-variable -Wno-pointer-sign -Wno-cast-qual +CC_C_OPT += -Wno-stringop-truncation CC_CXX_OPT += -Wall -fpermissive CC_OPT += -U__linux__ -D __KERNEL__ -DCONFIG_PCI diff --git a/repos/dde_linux/patches/lxip_log2.patch b/repos/dde_linux/patches/lxip_log2.patch new file mode 100644 index 000000000..8a7a05657 --- /dev/null +++ b/repos/dde_linux/patches/lxip_log2.patch @@ -0,0 +1,10 @@ +--- a/include/linux/log2.h 2016-02-25 21:01:36.000000000 +0100 ++++ b/include/linux/log2.h 2020-01-03 14:59:54.572400301 +0100 +@@ -18,7 +18,6 @@ + /* + * deal with unrepresentable constant logarithms + */ +-extern __attribute__((const, noreturn)) + int ____ilog2_NaN(void); + + /* diff --git a/repos/dde_linux/ports/dde_linux.hash b/repos/dde_linux/ports/dde_linux.hash index 7b5dd58c1..492443ae1 100644 --- a/repos/dde_linux/ports/dde_linux.hash +++ b/repos/dde_linux/ports/dde_linux.hash @@ -1 +1 @@ -234e76f366dc583176c0695d33886fb6576765c2 +8d086553e63be398b2e00ffa093fb4d44d6e746d diff --git a/repos/dde_linux/ports/dde_linux.port b/repos/dde_linux/ports/dde_linux.port index b4149d1aa..ac40d0134 100644 --- a/repos/dde_linux/ports/dde_linux.port +++ b/repos/dde_linux/ports/dde_linux.port @@ -156,6 +156,7 @@ PATCHES += $(addprefix patches/,$(notdir $(wildcard $(REP_DIR)/patches/usb_hid*. LXIP_OPT = -p1 -d$(SRC_DIR_LXIP) PATCH_OPT(patches/lxip_icmp.patch) := $(LXIP_OPT) PATCH_OPT(patches/lxip_ip_config.patch) := $(LXIP_OPT) +PATCH_OPT(patches/lxip_log2.patch) := $(LXIP_OPT) PATCH_OPT(patches/lxip_netlink.patch) := $(LXIP_OPT) PATCH_OPT(patches/lxip_request_sock.patch) := $(LXIP_OPT) PATCH_OPT(patches/lxip_sk_wq.patch) := $(LXIP_OPT) diff --git a/repos/dde_linux/src/drivers/framebuffer/intel/include/lx_emul.h b/repos/dde_linux/src/drivers/framebuffer/intel/include/lx_emul.h index f53a117d5..279cd5fb6 100644 --- a/repos/dde_linux/src/drivers/framebuffer/intel/include/lx_emul.h +++ b/repos/dde_linux/src/drivers/framebuffer/intel/include/lx_emul.h @@ -1262,12 +1262,9 @@ enum { MEMREMAP_WB = 1 << 0, }; -#define writel(value, addr) (*(volatile uint32_t *)(addr) = (value)) -#define readl(addr) (*(volatile uint32_t *)(addr)) - #define writel_relaxed(v, a) writel(v, a) -#define iowrite32(v, addr) writel((v), (addr)) -#define ioread32(addr) readl(addr) +#define iowrite32(v, addr) writel((v), (addr)) +#define ioread32(addr) readl(addr) void outb(u8 value, u32 port); void outw(u16 value, u32 port); diff --git a/repos/dde_linux/src/include/lx_emul/bug.h b/repos/dde_linux/src/include/lx_emul/bug.h index bd43d8e65..921a2624f 100644 --- a/repos/dde_linux/src/include/lx_emul/bug.h +++ b/repos/dde_linux/src/include/lx_emul/bug.h @@ -21,7 +21,7 @@ #define WARN_ON(condition) ({ \ int ret = !!(condition); \ - if (ret) lx_printf("[%s] WARN_ON(" #condition ") \n", __func__); \ + if (ret) lx_printf("[%s] WARN_ON(%s) \n", __func__, #condition); \ ret; }) #define WARN(condition, fmt, arg...) ({ \ diff --git a/repos/dde_linux/src/lib/lxip/include/lx_emul.h b/repos/dde_linux/src/lib/lxip/include/lx_emul.h index 29e355ddb..c5855f020 100644 --- a/repos/dde_linux/src/lib/lxip/include/lx_emul.h +++ b/repos/dde_linux/src/lib/lxip/include/lx_emul.h @@ -3056,10 +3056,10 @@ struct inet_diag_handler void inet_diag_dump_icsk(struct inet_hashinfo *, struct sk_buff *, - struct netlink_callback *, struct inet_diag_req_v2 *, + struct netlink_callback *, const struct inet_diag_req_v2 *, struct nlattr *); int inet_diag_dump_one_icsk(struct inet_hashinfo *, struct sk_buff *, - const struct nlmsghdr *, struct inet_diag_req_v2 *); + const struct nlmsghdr *, const struct inet_diag_req_v2 *); int inet_diag_register(const struct inet_diag_handler *); void inet_diag_unregister(const struct inet_diag_handler *); @@ -3424,9 +3424,9 @@ void trace_netif_rx_ni_entry(struct sk_buff*); void trace_netif_receive_skb_entry(struct sk_buff*); void trace_napi_gro_receive_entry(struct sk_buff*); void trace_napi_gro_frags_entry(struct sk_buff*); -void trace_fib_validate_source(struct net_device *, struct flowi4*); -void trace_fib_table_lookup(void*, void*); -void trace_fib_table_lookup_nh(void*); +void trace_fib_validate_source(const struct net_device *, const struct flowi4 *); +void trace_fib_table_lookup(const void *, const void *); +void trace_fib_table_lookup_nh(const void *); /******************