diff mbox series

[meta-networking,6/7] crda: Fix build with clang-15

Message ID 20220829065649.808556-6-raj.khem@gmail.com
State New
Headers show
Series [meta-python,1/7] python3-netifaces: Fix build with python3 and musl | expand

Commit Message

Khem Raj Aug. 29, 2022, 6:56 a.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../0001-reglib-Remove-unused-variables.patch | 59 +++++++++++++++++++
 .../recipes-connectivity/crda/crda_3.18.bb    |  1 +
 2 files changed, 60 insertions(+)
 create mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-reglib-Remove-unused-variables.patch
diff mbox series

Patch

diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-reglib-Remove-unused-variables.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-reglib-Remove-unused-variables.patch
new file mode 100644
index 0000000000..c6c3c53f19
--- /dev/null
+++ b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-reglib-Remove-unused-variables.patch
@@ -0,0 +1,59 @@ 
+From 1bd6ff9d10c83afbc9954fc38b953e9167e6d4a9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 28 Aug 2022 14:01:55 -0700
+Subject: [PATCH] reglib: Remove unused variables
+
+These counters are not used anywhere therefore delete them
+Fixes
+reglib.c:1015:15: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
+        unsigned int i = 0;
+                     ^
+reglib.c:1062:15: error: variable 'lines' set but not used [-Werror,-Wunused-but-set-variable]
+        unsigned int lines = 0;
+                     ^
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ reglib.c | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/reglib.c b/reglib.c
+index 8565a0b..6c62c2c 100644
+--- a/reglib.c
++++ b/reglib.c
+@@ -1012,7 +1012,6 @@ static int reglib_find_next_country_stream(FILE *fp)
+ {
+ 	fpos_t prev_pos;
+ 	int r;
+-	unsigned int i = 0;
+ 
+ 	while(1) {
+ 		char line[1024];
+@@ -1030,7 +1029,6 @@ static int reglib_find_next_country_stream(FILE *fp)
+ 		line_p = fgets(line, sizeof(line), fp);
+ 		if (line_p == line) {
+ 			if (strspn(line, "\n") == strlen(line)) {
+-				i++;
+ 				continue;
+ 			}
+ 			if (strncmp(line, "country", 7) != 0)
+@@ -1059,7 +1057,6 @@ struct ieee80211_regdomain *reglib_parse_country(FILE *fp)
+ 
+ FILE *reglib_create_parse_stream(FILE *f)
+ {
+-	unsigned int lines = 0;
+ 	FILE *fp;
+ 
+ 	fp = tmpfile();
+@@ -1076,7 +1073,6 @@ FILE *reglib_create_parse_stream(FILE *f)
+ 		if (line_p == line) {
+ 			if (strchr(line, '#') == NULL) {
+ 				fputs(line, fp);
+-				lines++;
+ 			}
+ 			continue;
+ 		} else
+-- 
+2.37.2
+
diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda_3.18.bb b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda_3.18.bb
index a616557e7c..2f4d4dac99 100644
--- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda_3.18.bb
+++ b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda_3.18.bb
@@ -16,6 +16,7 @@  SRC_URI = "https://www.kernel.org/pub/software/network/${BPN}/${BP}.tar.xz \
            file://fix-issues-when-USE_OPENSSL-1.patch \
            file://crda-4.14-python-3.patch \
            file://0001-Make-alpha2-to-be-3-characters-long.patch \
+           file://0001-reglib-Remove-unused-variables.patch \
 "
 SRC_URI[md5sum] = "0431fef3067bf503dfb464069f06163a"
 SRC_URI[sha256sum] = "43fcb9679f8b75ed87ad10944a506292def13e4afb194afa7aa921b01e8ecdbf"