From 5ed76afa814812edaeaff2ea7b3227c18d5de5a6 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 4 Aug 2020 12:29:59 +0200 Subject: pkg/compiler: check for unused resources If a resource is never used as an input, it is not useful. It's effectively the same as using an integer. Detect such cases, they are quite confusing. Fix all existing errors in descriptions. This uncovered some interesting bugs as well, e.g. use of a completely unrelated fd subtype after copy-paste (while the resource that was supposed to be used there is completely unused). --- sys/freebsd/socket_inet_icmp.txt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'sys/freebsd') diff --git a/sys/freebsd/socket_inet_icmp.txt b/sys/freebsd/socket_inet_icmp.txt index b4d8eaaa1..f2c2e84ec 100644 --- a/sys/freebsd/socket_inet_icmp.txt +++ b/sys/freebsd/socket_inet_icmp.txt @@ -7,12 +7,8 @@ include include include -resource sock_icmp[sock_in] +socket$inet_icmp(domain const[AF_INET], type const[SOCK_DGRAM], proto const[IPPROTO_ICMP]) sock_in +socket$inet_icmp_raw(domain const[AF_INET], type const[SOCK_RAW], proto const[IPPROTO_ICMP]) sock_in -socket$inet_icmp(domain const[AF_INET], type const[SOCK_DGRAM], proto const[IPPROTO_ICMP]) sock_icmp -socket$inet_icmp_raw(domain const[AF_INET], type const[SOCK_RAW], proto const[IPPROTO_ICMP]) sock_icmp - -resource sock_icmp6[sock_in6] - -socket$inet6_icmp(domain const[AF_INET6], type const[SOCK_DGRAM], proto const[IPPROTO_ICMPV6]) sock_icmp6 -socket$inet6_icmp_raw(domain const[AF_INET6], type const[SOCK_RAW], proto const[IPPROTO_ICMPV6]) sock_icmp6 +socket$inet6_icmp(domain const[AF_INET6], type const[SOCK_DGRAM], proto const[IPPROTO_ICMPV6]) sock_in6 +socket$inet6_icmp_raw(domain const[AF_INET6], type const[SOCK_RAW], proto const[IPPROTO_ICMPV6]) sock_in6 -- cgit mrf-deployment