From mboxrd@z Thu Jan 1 00:00:00 1970 From: kbuild test robot Subject: [PATCH] Bluetooth: fix err_cast.cocci warnings Date: Mon, 8 Dec 2014 03:04:38 +0800 Message-ID: <20141207190437.GA10752@waimea> References: <201412080310.KE1g5orD%fengguang.wu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kbuild-all-JC7UmRfGjtg@public.gmane.org, Marcel Holtmann , Gustavo Padovan , linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Johan Hedberg Return-path: Content-Disposition: inline In-Reply-To: <201412080310.KE1g5orD%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Sender: linux-bluetooth-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org 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 Signed-off-by: Fengguang Wu --- 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: