On 22.09.22 03:00, Jakub Kicinski wrote:
On Thu, 15 Sep 2022 22:36:35 +0200 Gerhard Engleder wrote:
+static int tsnep_add_rule(struct tsnep_adapter *adapter,
+ struct tsnep_rxnfc_rule *rule)
+{
+ struct tsnep_rxnfc_rule *pred, *cur;
+
+ tsnep_enable_rule(adapter, rule);
+
+ pred = NULL;
+ list_for_each_entry(cur, &adapter->rxnfc_rules, list) {
+ if (cur->location >= rule->location)
+ break;
+ pred = cur;
+ }
+
+ list_add(&rule->list, pred ? &pred->list : &adapter->rxnfc_rules);
+ adapter->rxnfc_count++;
+
+ return 0;
This never fails, perhaps the return code is unnecessary
I will simplify as suggested.