Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iavf: enhance the duplicated FDIR list scan handling

When the FDIR entry is found, just return the result directly to break
the loop.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>

authored by

Haiyue Wang and committed by
Tony Nguyen
f3b9da31 f995f95a

+3 -6
+3 -6
drivers/net/ethernet/intel/iavf/iavf_fdir.c
··· 713 713 bool iavf_fdir_is_dup_fltr(struct iavf_adapter *adapter, struct iavf_fdir_fltr *fltr) 714 714 { 715 715 struct iavf_fdir_fltr *tmp; 716 - bool ret = false; 717 716 718 717 list_for_each_entry(tmp, &adapter->fdir_list_head, list) { 719 718 if (tmp->flow_type != fltr->flow_type) ··· 723 724 !memcmp(&tmp->ip_data, &fltr->ip_data, 724 725 sizeof(fltr->ip_data)) && 725 726 !memcmp(&tmp->ext_data, &fltr->ext_data, 726 - sizeof(fltr->ext_data))) { 727 - ret = true; 728 - break; 729 - } 727 + sizeof(fltr->ext_data))) 728 + return true; 730 729 } 731 730 732 - return ret; 731 + return false; 733 732 } 734 733 735 734 /**