From: Veaceslav Falico Date: Sat, 3 Aug 2013 01:50:36 +0000 (+0200) Subject: bonding: add bond_time_in_interval() and use it for time comparison X-Git-Tag: v3.12-rc1~132^2~354 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7f63f1dc4bd643d9249c653e60c530d4a438147;p=pandora-kernel.git bonding: add bond_time_in_interval() and use it for time comparison Currently we use a lot of time comparison math for arp_interval comparisons, which are sometimes quite hard to read and understand. All the time comparisons have one pattern: (time - arp_interval_jiffies) <= jiffies <= (time + mod * arp_interval_jiffies + arp_interval_jiffies/2) Introduce a new helper - bond_time_in_interval(), which will do the math in one place and, thus, will clean up the logical code. This helper introduces a bit of overhead (by always calculating the jiffies from arp_interval), however it's really not visible, considering that functions using it usually run once in arp_interval milliseconds. There are several lines slightly over 80 chars, however breaking them would result in more hard-to-read code than several character after the 80 mark. CC: Jay Vosburgh CC: Andy Gospodarek Signed-off-by: Veaceslav Falico Signed-off-by: David S. Miller --- Reading git-diff-tree failed