From 0dc7084b0f6aa4d8aa3969c4bd404c461ca696a4 Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Thu, 17 Jun 2021 12:41:50 +0200 Subject: [PATCH] wifi_drv: fix compile warnings with gcc 10 Fixes #4202 --- .../dde_linux/src/include/lx_emul/impl/pci.h | 3 ++- repos/dde_linux/src/lib/libnl/socket.cc | 2 ++ repos/dde_linux/src/lib/wifi/dummies.cc | 3 --- .../dde_linux/src/lib/wifi/include/lx_emul.h | 2 +- repos/dde_linux/src/lib/wifi/lxcc_emul.cc | 2 +- .../src/lib/wpa_driver_nl80211/dummies.cc | 1 - .../lib/wpa_supplicant/ctrl_iface_genode.c | 19 ++++++++++--------- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/repos/dde_linux/src/include/lx_emul/impl/pci.h b/repos/dde_linux/src/include/lx_emul/impl/pci.h index a4c9d67881..39548fd57d 100644 --- a/repos/dde_linux/src/include/lx_emul/impl/pci.h +++ b/repos/dde_linux/src/include/lx_emul/impl/pci.h @@ -44,7 +44,8 @@ extern "C" int pci_register_driver(struct pci_driver *driver) pci_device_id const *matching_id = nullptr; for (pci_device_id const *id = id_table; id->device; id++) { if ((id->device == device_id) && - (id->subdevice == PCI_ANY_ID || id->subdevice == subdevice_id)) { + (id->subdevice == (unsigned int)PCI_ANY_ID || + id->subdevice == subdevice_id)) { matching_id = id; break; } diff --git a/repos/dde_linux/src/lib/libnl/socket.cc b/repos/dde_linux/src/lib/libnl/socket.cc index 4071244195..21a88043b4 100644 --- a/repos/dde_linux/src/lib/libnl/socket.cc +++ b/repos/dde_linux/src/lib/libnl/socket.cc @@ -247,6 +247,7 @@ ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags) w_msg.msg_name = msg->msg_name; w_msg.msg_namelen = msg->msg_namelen; w_msg.msg_iovlen = msg->msg_iovlen; + w_msg.msg_count = 0; for (unsigned i = 0; i < w_msg.msg_iovlen; ++i) { w_msg.msg_iov[i].iov_base = msg->msg_iov[i].iov_base; w_msg.msg_iov[i].iov_len = msg->msg_iov[i].iov_len; @@ -306,6 +307,7 @@ ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags) w_msg.msg_name = msg->msg_name; w_msg.msg_namelen = msg->msg_namelen; w_msg.msg_iovlen = msg->msg_iovlen; + w_msg.msg_count = 0; for (unsigned i = 0; i < w_msg.msg_iovlen; ++i) { w_msg.msg_iov[i].iov_base = msg->msg_iov[i].iov_base; w_msg.msg_iov[i].iov_len = msg->msg_iov[i].iov_len; diff --git a/repos/dde_linux/src/lib/wifi/dummies.cc b/repos/dde_linux/src/lib/wifi/dummies.cc index f39a59e427..a0cd49152f 100644 --- a/repos/dde_linux/src/lib/wifi/dummies.cc +++ b/repos/dde_linux/src/lib/wifi/dummies.cc @@ -210,7 +210,6 @@ DUMMY(0, ipv4_get_dsfield) DUMMY(0, ipv6_get_dsfield) DUMMY(0, ipv6_hdr) DUMMY(0, irqs_disabled) -DUMMY(0, isalpha) DUMMY(0, jhash_2words) DUMMY(0, kobject_uevent) DUMMY(0, kobject_uevent_env) @@ -282,7 +281,6 @@ DUMMY(0, smp_rmb) DUMMY(0, sock_net) DUMMY(0, sock_release) DUMMY(0, spin_trylock) -DUMMY(0, sscanf) DUMMY(0, synchronize_irq) DUMMY(0, synchronize_rcu_expedited) DUMMY(0, tasklet_disable) @@ -458,7 +456,6 @@ DUMMY(0, udp_hdr) DUMMY(0, virt_to_page) DUMMY(0, xfrm_sk_clone_policy) DUMMY(0, xfrm_sk_free_policy) -DUMMY(0, strncpy) DUMMY(0, __ethtool_get_settings) DUMMY(0, __skb_get_hash) diff --git a/repos/dde_linux/src/lib/wifi/include/lx_emul.h b/repos/dde_linux/src/lib/wifi/include/lx_emul.h index 86d5f4ad6f..1edb3c6fe8 100644 --- a/repos/dde_linux/src/lib/wifi/include/lx_emul.h +++ b/repos/dde_linux/src/lib/wifi/include/lx_emul.h @@ -353,7 +353,7 @@ struct page atomic_t _count; void *addr; unsigned long private; -} __attribute((packed)); +}; /********************** diff --git a/repos/dde_linux/src/lib/wifi/lxcc_emul.cc b/repos/dde_linux/src/lib/wifi/lxcc_emul.cc index cb40c3b299..1d9a11c6ab 100644 --- a/repos/dde_linux/src/lib/wifi/lxcc_emul.cc +++ b/repos/dde_linux/src/lib/wifi/lxcc_emul.cc @@ -1551,7 +1551,7 @@ struct Idr if (_barray.get(index, 1)) { return false; } _barray.set(index, 1); - _ptr[index] = ptr; + _ptr[index] = (addr_t)ptr; return true; } diff --git a/repos/dde_linux/src/lib/wpa_driver_nl80211/dummies.cc b/repos/dde_linux/src/lib/wpa_driver_nl80211/dummies.cc index eda4592bca..2cf40a7156 100644 --- a/repos/dde_linux/src/lib/wpa_driver_nl80211/dummies.cc +++ b/repos/dde_linux/src/lib/wpa_driver_nl80211/dummies.cc @@ -54,6 +54,5 @@ DUMMY(0, getprotobynumber) DUMMY(0, nl_addr_get_binary_addr) DUMMY(0, nl_addr_get_len) DUMMY(0, nl_hash_any) -DUMMY(0, rint) } /* extern "C" */ diff --git a/repos/dde_linux/src/lib/wpa_supplicant/ctrl_iface_genode.c b/repos/dde_linux/src/lib/wpa_supplicant/ctrl_iface_genode.c index d95ba997a4..e98c6fa91c 100644 --- a/repos/dde_linux/src/lib/wpa_supplicant/ctrl_iface_genode.c +++ b/repos/dde_linux/src/lib/wpa_supplicant/ctrl_iface_genode.c @@ -35,6 +35,7 @@ /* rep includes */ #include +typedef unsigned unaligned_unsigned __attribute__ ((aligned (1))); struct ctrl_iface_priv { struct wpa_supplicant *wpa_s; @@ -42,19 +43,19 @@ struct ctrl_iface_priv { int level; /* TODO replace w/ Msg_buffer */ - char *send_buffer; - size_t send_buffer_size; - unsigned *send_id; + char *send_buffer; + size_t send_buffer_size; + unaligned_unsigned *send_id; - char *recv_buffer; - size_t recv_buffer_size; - unsigned *recv_id; + char *recv_buffer; + size_t recv_buffer_size; + unaligned_unsigned *recv_id; unsigned last_recv_id; - char *event_buffer; - size_t event_buffer_size; - unsigned *event_id; + char *event_buffer; + size_t event_buffer_size; + unaligned_unsigned *event_id; };