]> www.infradead.org Git - users/jedix/linux-maple.git/commit
i40e: make use of hlist_for_each_entry_continue
authorJacob Keller <jacob.e.keller@intel.com>
Tue, 7 Mar 2017 23:17:52 +0000 (15:17 -0800)
committerJack Vogel <jack.vogel@oracle.com>
Sat, 10 Jun 2017 01:57:03 +0000 (18:57 -0700)
commit7dda5f54c2f9c0c6b9ec1275bda5e7922568b555
tree758e5bb4b0cb20b2b8ced238a931a352ade7276b
parentf9ad72f9cb1886a84c7206b6a7d578ad22ac2db7
i40e: make use of hlist_for_each_entry_continue

Replace a complex if->continue->else->break construction in
i40e_next_filter. We can simply use hlist_for_each_entry_continue
instead. This drops a lot of confusing code. The resulting code is much
easier to understand the intention, and follows the more normal pattern
for using hlist loops. We could have also used a break with a "return
next" at the end of the function, instead of return NULL, but the
current implementation is explicitly clear that when you reach the end
of the loop you get a NULL value. The alternative construction is less
clear since the reader would have to know that next is NULL at the end
of the loop.

Change-Id: Ife74ca451dd79d7f0d93c672bd42092d324d4a03
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Orabug: 26132523
(cherry picked from commit 584a88709bf4880ba5f8fed72da50512fbd9bdbb)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/intel/i40e/i40e_main.c