Filter out redundant ioctl entries early

For two ioctl entries with the same code, if one's name is a prefix
to another's name, keep the entry with a shorter name.  Filter out
redundant ioctl entries at ioctlsort stage so that distributed
ioctlent.h.in files will be already filtered.

* linux/ioctlsort.c (is_not_prefix): New function.
(main): Use it.
* linux/ioctlent-filter.awk: Remove.
* Makefile.am (EXTRA_DIST): Remove linux/ioctlent-filter.awk.
($(ioctlent_h)): Don't use linux/ioctlent-filter.awk.
diff --git a/linux/ioctlsort.c b/linux/ioctlsort.c
index dab30f1..393b534 100644
--- a/linux/ioctlsort.c
+++ b/linux/ioctlsort.c
@@ -30,6 +30,14 @@
 	return (code1 > code2) ? 1 : (code1 < code2) ? -1 : strcmp(name1, name2);
 }
 
+static int is_not_prefix(const char *s1, const char *s2) {
+	size_t len = strlen(s1);
+
+	if (len > strlen(s2))
+		return 1;
+	return memcmp(s1, s2, len);
+}
+
 int main(int argc, char** argv) {
 	int i;
 
@@ -41,8 +49,8 @@
 	qsort(ioctls, nioctls, sizeof(ioctls[0]), compare);
 	puts("\t/* Generated by ioctlsort */");
 	for (i = 0; i < nioctls; i++)
-		if (i == 0 || ioctls[i].code != ioctls[i-1].code ||
-		    strcmp(ioctls[i].name, ioctls[i-1].name))
+		if (i == 0 || ioctls[i-1].code != ioctls[i].code ||
+		    is_not_prefix(ioctls[i-1].name, ioctls[i].name))
 			printf("\t{\"%s\",\t\"%s\",\t%#06lx},\n",
 				ioctls[i].header, ioctls[i].name, ioctls[i].code);