diff options
author | Julien Cristau <jcristau@debian.org> | 2016-10-04 16:49:30 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-10-24 09:17:51 -0400 |
commit | 6fbbcf38730210dc00123ad0188002189716169d (patch) | |
tree | d4a446493f2869fe321194b9a3a6d6b235f1f715 | |
parent | 054d4b7b577de6f5d25a0d443f0d59410bf156ad (diff) |
hwrng: chaoskey - drop workaround for old hwrng core limitation
The hwrng core used to mask 'quality' with 1023; that has been removed
in commit 506bf0c0464ace57169aadcf02ae397999c57bdd ("hwrng: core - allow
perfect entropy from hardware devices"), so we can now just set quality
to 1024.
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/misc/chaoskey.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/usb/misc/chaoskey.c b/drivers/usb/misc/chaoskey.c index 6ddd08a32777..aa350dc9eb25 100644 --- a/drivers/usb/misc/chaoskey.c +++ b/drivers/usb/misc/chaoskey.c | |||
@@ -215,19 +215,7 @@ static int chaoskey_probe(struct usb_interface *interface, | |||
215 | 215 | ||
216 | dev->hwrng.name = dev->name ? dev->name : chaoskey_driver.name; | 216 | dev->hwrng.name = dev->name ? dev->name : chaoskey_driver.name; |
217 | dev->hwrng.read = chaoskey_rng_read; | 217 | dev->hwrng.read = chaoskey_rng_read; |
218 | 218 | dev->hwrng.quality = 1024; | |
219 | /* Set the 'quality' metric. Quality is measured in units of | ||
220 | * 1/1024's of a bit ("mills"). This should be set to 1024, | ||
221 | * but there is a bug in the hwrng core which masks it with | ||
222 | * 1023. | ||
223 | * | ||
224 | * The patch that has been merged to the crypto development | ||
225 | * tree for that bug limits the value to 1024 at most, so by | ||
226 | * setting this to 1024 + 1023, we get 1023 before the fix is | ||
227 | * merged and 1024 afterwards. We'll patch this driver once | ||
228 | * both bits of code are in the same tree. | ||
229 | */ | ||
230 | dev->hwrng.quality = 1024 + 1023; | ||
231 | 219 | ||
232 | dev->hwrng_registered = (hwrng_register(&dev->hwrng) == 0); | 220 | dev->hwrng_registered = (hwrng_register(&dev->hwrng) == 0); |
233 | if (!dev->hwrng_registered) | 221 | if (!dev->hwrng_registered) |