From: Johannes Schlumberger Date: Tue, 20 Mar 2007 21:55:58 +0000 (+1100) Subject: [CRYPTO] doc: Fix typo in hash example X-Git-Tag: MMI-PSA29.97-13-9~44574^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=58e40308f329275ccf556312a9cd788522f7c224;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git [CRYPTO] doc: Fix typo in hash example there is a tiny bug in Documentation/crypto/api-intro.txt. The file has the following example code: struct scatterlist sg[2]; [...] if (crypto_hash_digest(&desc, &sg, 2, result)) which does not match the declaration of crypto_hash_digest() in include/linux/crypto.h. (static inline int crypto_hash_digest(struct hash_desc *desc, struct scatterlist *sg, unsigned int nbytes, u8 *out) The code in the example passes the address of a pointer (an array actually) as the second argument, while the function expects the pointer itself. I have attached a patch to fix this. Signed-off-by: Herbert Xu --- diff --git a/Documentation/crypto/api-intro.txt b/Documentation/crypto/api-intro.txt index e41a79aa71ce..9b84b805ab75 100644 --- a/Documentation/crypto/api-intro.txt +++ b/Documentation/crypto/api-intro.txt @@ -60,7 +60,7 @@ Here's an example of how to use the API: desc.tfm = tfm; desc.flags = 0; - if (crypto_hash_digest(&desc, &sg, 2, result)) + if (crypto_hash_digest(&desc, sg, 2, result)) fail(); crypto_free_hash(tfm);