Thread (1 message) 1 message, 1 author, 2014-12-07
DORMANTno replies

[PATCH] Bluetooth: fix err_cast.cocci warnings

From: kbuild test robot <hidden>
Date: 2014-12-07 19:06:05
Also in: linux-bluetooth, lkml

net/bluetooth/smp.c:2650:9-16: WARNING: ERR_CAST can be used with tfm_aes


 Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))

Generated by: scripts/coccinelle/api/err_cast.cocci

CC: Johan Hedberg <redacted>
Signed-off-by: Fengguang Wu <redacted>
---

 smp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -2647,7 +2647,7 @@ static struct l2cap_chan *smp_add_cid(st
 	tfm_aes = crypto_alloc_blkcipher("ecb(aes)", 0, 0);
 	if (IS_ERR(tfm_aes)) {
 		BT_ERR("Unable to create crypto context");
-		return ERR_PTR(PTR_ERR(tfm_aes));
+		return ERR_CAST(tfm_aes);
 	}
 
 create_chan:
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help