aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sctp/structs.h
diff options
context:
space:
mode:
authorVeaceslav Falico <vfalico@redhat.com>2013-08-02 21:50:36 -0400
committerDavid S. Miller <davem@davemloft.net>2013-08-05 15:19:45 -0400
commite7f63f1dc4bd643d9249c653e60c530d4a438147 (patch)
tree7a8d9bcb5951e88100f2e466c7f19d2719871d82 /include/net/sctp/structs.h
parentdef4460cdb171d64309c927907c18c4efcb0204b (diff)
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 <fubar@us.ibm.com> CC: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Veaceslav Falico <vfalico@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sctp/structs.h')
0 files changed, 0 insertions, 0 deletions