Skip to contentSkip to conversation

kconf: sync with upstream version 37861ffa8c28

PATCH In review Felix Fietkau 2 participants 5 messages Nov 16, 2017 – Nov 17, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 kconf: sync with upstream version 37861ffa8c28

Adds support for the imply keyword

---
 backport/kconf/conf.c       |    7 +-
 backport/kconf/confdata.c   |   19 +-
 backport/kconf/expr.c       |    2 +-
 backport/kconf/expr.h       |    2 +
 backport/kconf/menu.c       |   57 +-
 backport/kconf/symbol.c     |   43 +-
 backport/kconf/zconf.hash.c |   68 +-
 backport/kconf/zconf.lex.c  |  325 +++++----
 backport/kconf/zconf.tab.c  | 1581 ++++++++++++++++++++-----------------------
 9 files changed, 1032 insertions(+), 1072 deletions(-)
backport/kconf/conf.c +4 -3
index 6c204318..866369f1 100644
@@ -5,6 +5,7 @@
 
 #include <locale.h>
 #include <ctype.h>
+#include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -41,7 +42,7 @@ static int tty_stdio;
 static int valid_stdin = 1;
 static int sync_kconfig;
 static int conf_cnt;
-static char line[128];
+static char line[PATH_MAX];
 static struct menu *rootEntry;
 
 static void print_help(struct menu *menu)
@@ -109,7 +110,7 @@ static int conf_askvalue(struct symbol *sym, const char *def)
 		/* fall through */
 	case oldaskconfig:
 		fflush(stdout);
-		xfgets(line, 128, stdin);
+		xfgets(line, sizeof(line), stdin);
 		if (!tty_stdio)
 			printf("\n");
 		return 1;
@@ -311,7 +312,7 @@ static int conf_choice(struct menu *menu)
 			/* fall through */
 		case oldaskconfig:
 			fflush(stdout);
-			xfgets(line, 128, stdin);
+			xfgets(line, sizeof(line), stdin);
 			strip(line);
 			if (line[0] == '?') {
 				print_help(menu);
backport/kconf/confdata.c +10 -9
index c814f576..297b079a 100644
@@ -267,11 +267,8 @@ int conf_read_simple(const char *name, int def)
 		if (in)
 			goto load;
 		sym_add_change_count(1);
-		if (!sym_defconfig_list) {
-			if (modules_sym)
-				sym_calc_value(modules_sym);
+		if (!sym_defconfig_list)
 			return 1;
-		}
 
 		for_all_defaults(sym_defconfig_list, prop) {
 			if (expr_calc_value(prop->visible.expr) == no ||
@@ -378,7 +375,9 @@ load:
 				continue;
 		} else {
 			if (line[0] != '\r' && line[0] != '\n')
-				conf_warning("unexpected data");
+				conf_warning("unexpected data: %.*s",
+					     (int)strcspn(line, "\r\n"), line);
+
 			continue;
 		}
 setsym:
@@ -404,9 +403,6 @@ setsym:
 	}
 	free(line);
 	fclose(in);
-
-	if (modules_sym)
-		sym_calc_value(modules_sym);
 	return 0;
 }
 
@@ -417,8 +413,12 @@ int conf_read(const char *name)
 
 	sym_set_change_count(0);
 
-	if (conf_read_simple(name, S_DEF_USER))
+	if (conf_read_simple(name, S_DEF_USER)) {
+		sym_calc_value(modules_sym);
 		return 1;
+	}
+
+	sym_calc_value(modules_sym);
 
 	for_all_symbols(i, sym) {
 		sym_calc_value(sym);
@@ -849,6 +849,7 @@ static int conf_split_config(void)
 
 	name = conf_get_autoconfig_name();
 	conf_read_simple(name, S_DEF_AUTO);
+	sym_calc_value(modules_sym);
 
 	if (chdir("include/config"))
 		return 1;
backport/kconf/expr.c +1 -1
index 667d1aa2..cbf4996d 100644
@@ -1113,7 +1113,7 @@ void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char *
 			fn(data, e->left.sym, e->left.sym->name);
 		else
 			fn(data, NULL, "<choice>");
-		fn(data, NULL, e->type == E_LEQ ? ">=" : ">");
+		fn(data, NULL, e->type == E_GEQ ? ">=" : ">");
 		fn(data, e->right.sym, e->right.sym->name);
 		break;
 	case E_UNEQUAL:
backport/kconf/expr.h +2 -0
index 973b6f73..a73f762c 100644
@@ -85,6 +85,7 @@ struct symbol {
 	struct property *prop;
 	struct expr_value dir_dep;
 	struct expr_value rev_dep;
+	struct expr_value implied;
 };
 
 #define for_all_symbols(i, sym) for (i = 0; i < SYMBOL_HASHSIZE; i++) for (sym = symbol_hash[i]; sym; sym = sym->next) if (sym->type != S_OTHER)
@@ -136,6 +137,7 @@ enum prop_type {
 	P_DEFAULT,  /* default y */
 	P_CHOICE,   /* choice value */
 	P_SELECT,   /* select BAR */
+	P_IMPLY,    /* imply BAR */
 	P_RANGE,    /* range 7..100 (for a symbol) */
 	P_ENV,      /* value from environment variable */
 	P_SYMBOL,   /* where a symbol is defined */
backport/kconf/menu.c +40 -17

112 lines not on this page · raw message

backport/kconf/symbol.c +40 -3

103 lines not on this page · raw message

backport/kconf/zconf.hash.c +38 -30

174 lines not on this page · raw message

backport/kconf/zconf.lex.c +161 -164

725 lines not on this page · raw message

backport/kconf/zconf.tab.c +736 -845

1,782 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 4 lines
2.14.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in

Part of the diff is not shown here. View the raw message.

#1 lore raw

PATCH 2/4 backport-include: backport skb_get_hash_perturb

---
 backport/backport-include/linux/skbuff.h | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)
backport/backport-include/linux/skbuff.h +18 -4
index 61f3b98f..034206b6 100644
@@ -306,14 +306,28 @@ static inline void skb_free_frag(void *data)
 	put_page(virt_to_head_page(data));
 }
 
-/* iwlwifi doesn't need this function, so it's safe to just return 0 */
-static inline
-__u32 skb_get_hash_perturb(const struct sk_buff *skb, u32 perturb)
+#if LINUX_VERSION_IS_LESS(3,3,0)
+
+static inline u32 skb_get_hash_perturb(struct sk_buff *skb, u32 key)
 {
 	return 0;
 }
 
-#endif
+#else
+#include <net/flow_keys.h>
+#include <linux/jhash.h>
+
+static inline u32 skb_get_hash_perturb(struct sk_buff *skb, u32 key)
+{
+	struct flow_keys keys;
+
+	skb_flow_dissect(skb, &keys);
+	return jhash_3words((__force u32)keys.dst,
+			    (__force u32)keys.src ^ keys.ip_proto,
+			    (__force u32)keys.ports, key);
+}
+#endif /* LINUX_VERSION_IS_LESS(3,3,0) */
+#endif /* LINUX_VERSION_IS_LESS(4,2,0) */
 
 #if LINUX_VERSION_IS_LESS(4,13,0)
 static inline void *backport_skb_put(struct sk_buff *skb, unsigned int len)
Signature · 4 lines
2.14.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in
#2 lore raw

PATCH 3/4 backports: fix events with extack backport

In reply to Felix Fietkau

The multicast group offset needs to be synced after registering the family, otherwise multicast messages will use the wrong id

---
 backport/compat/backport-4.12.c | 1 +
 1 file changed, 1 insertion(+)
backport/compat/backport-4.12.c +1 -0
index f997b6c5..5e763084 100644
@@ -224,6 +224,7 @@ int bp_extack_genl_register_family(struct genl_family *family)
 
 	/* copy this since the family might access it directly */
 	family->attrbuf = copy->family.attrbuf;
+	family->mcgrp_offset = copy->family.mcgrp_offset;
 
 	mutex_lock(&copies_mutex);
 	list_add_tail(&copy->list, &copies_list);
Signature · 4 lines
2.14.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in
#3 lore raw

PATCH 4/4 backports: fix missing linux/verification.h error on < 4.7

In reply to Felix Fietkau
---
 backport/backport-include/linux/verification.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
backport/backport-include/linux/verification.h +2 -2
index 10e1bcfb..5fd0a2d3 100644
@@ -1,7 +1,7 @@
 #ifndef __BP_VERIFICATION_H
 #define __BP_VERIFICATION_H
 #include <linux/version.h>
-#ifndef CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION
+#if LINUX_VERSION_IS_GEQ(4,7,0) && !defined(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION)
 #include_next <linux/verification.h>
 #else
 #include <linux/key.h>
@@ -24,5 +24,5 @@ extern int verify_pkcs7_signature(const void *data, size_t len,
 						      const void *data, size_t len,
 						      size_t asn1hdrlen),
 				  void *ctx);
-#endif /* LINUX_VERSION_IS_GEQ(4,7,0) */
+#endif /* LINUX_VERSION_IS_GEQ(4,7,0) && !defined(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) */
 #endif /* __BP_VERIFICATION_H */
Signature · 4 lines
2.14.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in