* [PATCH] Bluetooth: fix err_cast.cocci warnings
[not found] ` <201412080310.KE1g5orD%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2014-12-07 19:04 ` kbuild test robot
0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2014-12-07 19:04 UTC (permalink / raw)
To: Johan Hedberg
Cc: kbuild-all-JC7UmRfGjtg, Marcel Holtmann, Gustavo Padovan,
linux-bluetooth-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
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 <johan.hedberg-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Fengguang Wu <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
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:
^ permalink raw reply [flat|nested] only message in thread