提交 58e40308 编写于 作者: J Johannes Schlumberger 提交者: Herbert Xu

[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: NHerbert Xu <herbert@gondor.apana.org.au>
上级 f70ee5ec
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册