]> git.michaelhowe.org Git - packages/o/openafs.git/commit
rx: Make clock_Add correctly add to itself
authorSimon Wilkinson <sxw@your-file-system.com>
Sat, 18 Jun 2011 10:48:45 +0000 (11:48 +0100)
committerDerrick Brashear <shadow@dementia.org>
Sat, 9 Jul 2011 05:05:40 +0000 (22:05 -0700)
commit8cc356cb64831a9aa860f53ec8ad4c20951af934
treebd144ee2c9127e7c011aed29c586213c9532ef47
parent1b28e72a4335c15cebf3f422a20b29a7049d7a4a
rx: Make clock_Add correctly add to itself

With the existing clock_Add code, the following:
    struct clock a = {2, 800000};
    clock_Add(&a, &a);
gives a clock value of {6, 600000}, rather than the expected {5, 60000}.

This is because the ordering of instructions leads it to double count
the carry on the seconds field. Reorder the instructions so that the
carry is correctly applied.

Reviewed-on: http://gerrit.openafs.org/4864
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 784babbea1247660f39463403233589a74c6e73b)

Change-Id: I1e97e9734d04f898dabad59a88afc929d8888e90
Reviewed-on: http://gerrit.openafs.org/4936
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/rx/rx_clock.h