misc: remove unnecessary cast in classify 69/20869/1
authorZhiyong Yang <zhiyong.yang@intel.com>
Fri, 26 Jul 2019 02:44:01 +0000 (22:44 -0400)
committerZhiyong Yang <zhiyong.yang@intel.com>
Fri, 26 Jul 2019 02:50:30 +0000 (22:50 -0400)
Type: style

Change-Id: I7628f7fba8250afe41f115595cca4129e43350d3
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
src/vnet/classify/flow_classify_node.c
src/vnet/classify/ip_classify.c

index 865281e..9462d46 100644 (file)
@@ -122,13 +122,11 @@ flow_classify_inline (vlib_main_t * vm,
 
       t1 = pool_elt_at_index (vcm->tables, table_index1);
 
-      vnet_buffer (b0)->l2_classify.hash =
-       vnet_classify_hash_packet (t0, (u8 *) h0);
+      vnet_buffer (b0)->l2_classify.hash = vnet_classify_hash_packet (t0, h0);
 
       vnet_classify_prefetch_bucket (t0, vnet_buffer (b0)->l2_classify.hash);
 
-      vnet_buffer (b1)->l2_classify.hash =
-       vnet_classify_hash_packet (t1, (u8 *) h1);
+      vnet_buffer (b1)->l2_classify.hash = vnet_classify_hash_packet (t1, h1);
 
       vnet_classify_prefetch_bucket (t1, vnet_buffer (b1)->l2_classify.hash);
 
@@ -158,8 +156,7 @@ flow_classify_inline (vlib_main_t * vm,
        fcm->classify_table_index_by_sw_if_index[tid][sw_if_index0];
 
       t0 = pool_elt_at_index (vcm->tables, table_index0);
-      vnet_buffer (b0)->l2_classify.hash =
-       vnet_classify_hash_packet (t0, (u8 *) h0);
+      vnet_buffer (b0)->l2_classify.hash = vnet_classify_hash_packet (t0, h0);
 
       vnet_buffer (b0)->l2_classify.table_index = table_index0;
       vnet_classify_prefetch_bucket (t0, vnet_buffer (b0)->l2_classify.hash);
@@ -230,7 +227,7 @@ flow_classify_inline (vlib_main_t * vm,
            {
              hash0 = vnet_buffer (b0)->l2_classify.hash;
              t0 = pool_elt_at_index (vcm->tables, table_index0);
-             e0 = vnet_classify_find_entry (t0, (u8 *) h0, hash0, now);
+             e0 = vnet_classify_find_entry (t0, h0, hash0, now);
              if (e0)
                {
                  hits++;
@@ -241,7 +238,7 @@ flow_classify_inline (vlib_main_t * vm,
                  vnet_classify_add_del_session (vcm, table_index0,
                                                 h0, ~0, 0, 0, 0, 0, 1);
                  /* increment counter */
-                 vnet_classify_find_entry (t0, (u8 *) h0, hash0, now);
+                 vnet_classify_find_entry (t0, h0, hash0, now);
                }
            }
          if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)
index 43ad2e8..d598d1a 100644 (file)
@@ -109,13 +109,11 @@ ip_classify_inline (vlib_main_t * vm,
 
       bi0 = from[0];
       b0 = vlib_get_buffer (vm, bi0);
-      h0 = (void *) vlib_buffer_get_current (b0) -
-       ethernet_buffer_header_size (b0);
+      h0 = vlib_buffer_get_current (b0) - ethernet_buffer_header_size (b0);
 
       bi1 = from[1];
       b1 = vlib_get_buffer (vm, bi1);
-      h1 = (void *) vlib_buffer_get_current (b1) -
-       ethernet_buffer_header_size (b1);
+      h1 = vlib_buffer_get_current (b1) - ethernet_buffer_header_size (b1);
 
       cd_index0 = vnet_buffer (b0)->ip.adj_index[VLIB_TX];
       cd0 = classify_dpo_get (cd_index0);
@@ -129,13 +127,11 @@ ip_classify_inline (vlib_main_t * vm,
 
       t1 = pool_elt_at_index (vcm->tables, table_index1);
 
-      vnet_buffer (b0)->l2_classify.hash =
-       vnet_classify_hash_packet (t0, (u8 *) h0);
+      vnet_buffer (b0)->l2_classify.hash = vnet_classify_hash_packet (t0, h0);
 
       vnet_classify_prefetch_bucket (t0, vnet_buffer (b0)->l2_classify.hash);
 
-      vnet_buffer (b1)->l2_classify.hash =
-       vnet_classify_hash_packet (t1, (u8 *) h1);
+      vnet_buffer (b1)->l2_classify.hash = vnet_classify_hash_packet (t1, h1);
 
       vnet_classify_prefetch_bucket (t1, vnet_buffer (b1)->l2_classify.hash);
 
@@ -159,16 +155,14 @@ ip_classify_inline (vlib_main_t * vm,
 
       bi0 = from[0];
       b0 = vlib_get_buffer (vm, bi0);
-      h0 = (void *) vlib_buffer_get_current (b0) -
-       ethernet_buffer_header_size (b0);
+      h0 = vlib_buffer_get_current (b0) - ethernet_buffer_header_size (b0);
 
       cd_index0 = vnet_buffer (b0)->ip.adj_index[VLIB_TX];
       cd0 = classify_dpo_get (cd_index0);
       table_index0 = cd0->cd_table_index;
 
       t0 = pool_elt_at_index (vcm->tables, table_index0);
-      vnet_buffer (b0)->l2_classify.hash =
-       vnet_classify_hash_packet (t0, (u8 *) h0);
+      vnet_buffer (b0)->l2_classify.hash = vnet_classify_hash_packet (t0, h0);
 
       vnet_buffer (b0)->l2_classify.table_index = table_index0;
       vnet_classify_prefetch_bucket (t0, vnet_buffer (b0)->l2_classify.hash);
@@ -237,7 +231,7 @@ ip_classify_inline (vlib_main_t * vm,
              hash0 = vnet_buffer (b0)->l2_classify.hash;
              t0 = pool_elt_at_index (vcm->tables, table_index0);
 
-             e0 = vnet_classify_find_entry (t0, (u8 *) h0, hash0, now);
+             e0 = vnet_classify_find_entry (t0, h0, hash0, now);
              if (e0)
                {
                  vnet_buffer (b0)->l2_classify.opaque_index
@@ -262,9 +256,8 @@ ip_classify_inline (vlib_main_t * vm,
                          break;
                        }
 
-                     hash0 = vnet_classify_hash_packet (t0, (u8 *) h0);
-                     e0 = vnet_classify_find_entry
-                       (t0, (u8 *) h0, hash0, now);
+                     hash0 = vnet_classify_hash_packet (t0, h0);
+                     e0 = vnet_classify_find_entry (t0, h0, hash0, now);
                      if (e0)
                        {
                          vnet_buffer (b0)->l2_classify.opaque_index