]> 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)
commita637dec56bf19a3d5407ed27f1c8716b12e4e739
tree9e2cd3196e964515cfcfbfcfe343201b42cfe6c9
parent5ba2e51404c4a922b145dda08e3c45b906f1dc4c
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