]> git.baikalelectronics.ru Git - kernel.git/commit
random: simplify accounting logic
authorGreg Price <price@MIT.EDU>
Fri, 29 Nov 2013 20:56:16 +0000 (15:56 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 20 Mar 2014 02:18:51 +0000 (22:18 -0400)
commitfb22bbb0fe28f268947c9c6321bba4b9478b7338
tree9e2cd3196e964515cfcfbfcfe343201b42cfe6c9
parent3400e8136a2947b83b6834c0e6a887777f6538da
random: simplify accounting logic

This logic is exactly equivalent to the old logic, but it should
be easier to see what it's doing.

The equivalence depends on one fact from outside this function:
when 'r->limit' is false, 'reserved' is zero.  (Well, two facts;
the other is that 'reserved' is never negative.)

Cc: Jiri Kosina <jkosina@suse.cz>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Greg Price <price@mit.edu>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
drivers/char/random.c