crypto: hash - Make setkey optional

Since most cryptographic hash algorithms have no keys, this patch
makes the setkey function optional for ahash and shash.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
diff --git a/crypto/shash.c b/crypto/shash.c
index 50d69a4..c9df367 100644
--- a/crypto/shash.c
+++ b/crypto/shash.c
@@ -55,6 +55,9 @@
 	struct shash_alg *shash = crypto_shash_alg(tfm);
 	unsigned long alignmask = crypto_shash_alignmask(tfm);
 
+	if (!shash->setkey)
+		return -ENOSYS;
+
 	if ((unsigned long)key & alignmask)
 		return shash_setkey_unaligned(tfm, key, keylen);