On 1/5/2016 10:04 PM, Saeed Mahameed wrote:
+static bool is_valid_attr(struct ib_flow_attr *flow_attr)
+{
+       union ib_flow_spec *ib_spec = (union ib_flow_spec *)(flow_attr + 1);
+       bool has_ipv4_spec = false;
+       bool eth_type_ipv4 = true;
+       unsigned int spec_index;
+
+       /* Validate that ehtertype is correct */
typo s/ehtertype/ethertype/ -- better if you grep all comments in the patches and run them through speller
+       for (spec_index = 0; spec_index < flow_attr->num_of_specs; 
spec_index++) {
+               if (ib_spec->type == IB_FLOW_SPEC_ETH &&
+                   ib_spec->eth.mask.ether_type) {
+                       eth_type_ipv4 = ib_spec->eth.mask.ether_type == 0xffff 
&&

sparse complains here on this

drivers/infiniband/hw/mlx5//main.c:1006:58: warning: restricted __be16 degrades to integer

even if this isn't real bug, make the tool happy, so we'll have the driver keep being clean from such warns

+                               ib_spec->eth.val.ether_type == htons(ETH_P_IP);
+               } else if (ib_spec->type == IB_FLOW_SPEC_IPV4) {
+                       has_ipv4_spec = true;
+               }
+               ib_spec = (void *)ib_spec + ib_spec->size;
+       }
+       return !has_ipv4_spec || eth_type_ipv4;
+}

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to