From patchwork Thu Mar 19 04:39:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "M. Vefa Bicakci" X-Patchwork-Id: 6046091 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5C7E79FB96 for ; Thu, 19 Mar 2015 04:40:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50C8020465 for ; Thu, 19 Mar 2015 04:40:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3251C204AF for ; Thu, 19 Mar 2015 04:40:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751944AbbCSEkC (ORCPT ); Thu, 19 Mar 2015 00:40:02 -0400 Received: from aibo.runbox.com ([91.220.196.211]:41576 "EHLO aibo.runbox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753289AbbCSEjz (ORCPT ); Thu, 19 Mar 2015 00:39:55 -0400 Received: from [10.9.9.209] (helo=mailfront04.runbox.com) by bars.runbox.com with esmtp (Exim 4.71) (envelope-from ) id 1YYSFN-0004RN-5a; Thu, 19 Mar 2015 05:39:53 +0100 Received: from cpe5cd9985fdb46-cm602ad088a62b.cpe.net.cable.rogers.com ([99.241.131.156] helo=localhost.localdomain) by mailfront04.runbox.com with esmtpsa (uid:769847 ) (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) id 1YYSFK-0007IA-FT; Thu, 19 Mar 2015 05:39:50 +0100 From: "M. Vefa Bicakci" To: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org Cc: Jes.Sorensen@redhat.com, joe@perches.com, Larry.Finger@lwfinger.net, gregkh@linuxfoundation.org, mail@beyermatthias.de, m.v.b@runbox.com Subject: [PATCH v3 14/15] staging: rtl8723au: Use __func__ in trace logs Date: Thu, 19 Mar 2015 00:39:17 -0400 Message-Id: <1426739958-18949-15-git-send-email-m.v.b@runbox.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1426739958-18949-1-git-send-email-m.v.b@runbox.com> References: <1426739958-18949-1-git-send-email-m.v.b@runbox.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Rework the trace log-related lines in rtl8723au's rtw_security.c to use the __func__ GCC magic variable instead of hardcoding the function names into the trace log strings. This also corrects a copy-paste-related typo in the function named rtw_tkip_decrypt23a. Thanks to Jes Sorensen for the suggestion to use __func__. Signed-off-by: M. Vefa Bicakci --- drivers/staging/rtl8723au/core/rtw_security.c | 49 ++++++++++++++++----------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_security.c b/drivers/staging/rtl8723au/core/rtw_security.c index eb3544866a..cdb3707fb2 100644 --- a/drivers/staging/rtl8723au/core/rtw_security.c +++ b/drivers/staging/rtl8723au/core/rtw_security.c @@ -248,9 +248,9 @@ void rtw_wep_decrypt23a(struct rtw_adapter *padapter, if (actual_crc != expected_crc) { RT_TRACE(_module_rtl871x_security_c_, _drv_err_, - ("rtw_wep_decrypt23a:icv CRC mismatch: " + ("%s:icv CRC mismatch: " "actual: %08x, expected: %08x\n", - actual_crc, expected_crc)); + __func__, actual_crc, expected_crc)); } } @@ -634,7 +634,8 @@ int rtw_tkip_encrypt23a(struct rtw_adapter *padapter, } if (stainfo == NULL) { - RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_tkip_encrypt23a: stainfo == NULL!!!\n")); + RT_TRACE(_module_rtl871x_security_c_, _drv_err_, + ("%s: stainfo == NULL!!!\n", __func__)); DBG_8723A("%s, psta == NUL\n", __func__); return _FAIL; } @@ -644,7 +645,8 @@ int rtw_tkip_encrypt23a(struct rtw_adapter *padapter, return _FAIL; } - RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_tkip_encrypt23a: stainfo!= NULL!!!\n")); + RT_TRACE(_module_rtl871x_security_c_, _drv_err_, + ("%s: stainfo!= NULL!!!\n", __func__)); if (is_multicast_ether_addr(pattrib->ra)) prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; @@ -718,7 +720,8 @@ int rtw_tkip_decrypt23a(struct rtw_adapter *padapter, stainfo = rtw_get_stainfo23a(&padapter->stapriv, &prxattrib->ta[0]); if (stainfo == NULL) { - RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_tkip_decrypt23a: stainfo == NULL!!!\n")); + RT_TRACE(_module_rtl871x_security_c_, _drv_err_, + ("%s: stainfo == NULL!!!\n", __func__)); return _FAIL; } @@ -731,7 +734,8 @@ int rtw_tkip_decrypt23a(struct rtw_adapter *padapter, prwskey = psecuritypriv->dot118021XGrpKey[prxattrib->key_index].skey; prwskeylen = 16; } else { - RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_tkip_decrypt23a: stainfo!= NULL!!!\n")); + RT_TRACE(_module_rtl871x_security_c_, _drv_err_, + ("%s: stainfo!= NULL!!!\n", __func__)); prwskey = &stainfo->dot118021x_UncstKey.skey[0]; prwskeylen = 16; } @@ -757,9 +761,9 @@ int rtw_tkip_decrypt23a(struct rtw_adapter *padapter, if (actual_crc != expected_crc) { RT_TRACE(_module_rtl871x_security_c_, _drv_err_, - ("rtw_wep_decrypt23a:icv CRC mismatch: " + ("%s:icv CRC mismatch: " "actual: %08x, expected: %08x\n", - actual_crc, expected_crc)); + __func__, actual_crc, expected_crc)); res = _FAIL; } @@ -1296,7 +1300,7 @@ int rtw_aes_encrypt23a(struct rtw_adapter *padapter, if (!stainfo) { RT_TRACE(_module_rtl871x_security_c_, _drv_err_, - ("rtw_aes_encrypt23a: stainfo == NULL!!!\n")); + ("%s: stainfo == NULL!!!\n", __func__)); DBG_8723A("%s, psta == NUL\n", __func__); res = _FAIL; goto out; @@ -1307,7 +1311,7 @@ int rtw_aes_encrypt23a(struct rtw_adapter *padapter, return _FAIL; } RT_TRACE(_module_rtl871x_security_c_, _drv_err_, - ("rtw_aes_encrypt23a: stainfo!= NULL!!!\n")); + ("%s: stainfo!= NULL!!!\n", __func__)); if (is_multicast_ether_addr(pattrib->ra)) prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; @@ -1535,10 +1539,16 @@ static int aes_decipher(u8 *key, uint hdrlen, u8 *pframe, uint plen) for (i = 0; i < 8; i++) { if (pframe[hdrlen + 8 + plen - 8 + i] != message[hdrlen + 8 + plen - 8 + i]) { RT_TRACE(_module_rtl871x_security_c_, _drv_err_, - ("aes_decipher:mic check error mic[%d]: pframe(%x) != message(%x)\n", - i, pframe[hdrlen + 8 + plen - 8 + i], message[hdrlen + 8 + plen - 8 + i])); - DBG_8723A("aes_decipher:mic check error mic[%d]: pframe(%x) != message(%x)\n", - i, pframe[hdrlen + 8 + plen - 8 + i], message[hdrlen + 8 + plen - 8 + i]); + ("%s:mic check error mic[%d]: " + "pframe(%x) != message(%x)\n", + __func__, i, + pframe[hdrlen + 8 + plen - 8 + i], + message[hdrlen + 8 + plen - 8 + i])); + DBG_8723A("%s:mic check error mic[%d]: " + "pframe(%x) != message(%x)\n", + __func__, i, + pframe[hdrlen + 8 + plen - 8 + i], + message[hdrlen + 8 + plen - 8 + i]); res = _FAIL; } } @@ -1564,13 +1574,13 @@ int rtw_aes_decrypt23a(struct rtw_adapter *padapter, stainfo = rtw_get_stainfo23a(&padapter->stapriv, &prxattrib->ta[0]); if (!stainfo) { RT_TRACE(_module_rtl871x_security_c_, _drv_err_, - ("rtw_aes_encrypt23a: stainfo == NULL!!!\n")); + ("%s: stainfo == NULL!!!\n", __func__)); res = _FAIL; goto exit; } RT_TRACE(_module_rtl871x_security_c_, _drv_err_, - ("rtw_aes_decrypt23a: stainfo!= NULL!!!\n")); + ("%s: stainfo!= NULL!!!\n", __func__)); if (is_multicast_ether_addr(prxattrib->ra)) { /* in concurrent we should use sw decrypt in @@ -1605,9 +1615,10 @@ void rtw_use_tkipkey_handler23a(void *FunctionContext) { struct rtw_adapter *padapter = (struct rtw_adapter *)FunctionContext; - RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("^^^rtw_use_tkipkey_handler23a ^^^\n")); + RT_TRACE(_module_rtl871x_security_c_, _drv_err_, + ("^^^%s^^^\n", __func__)); padapter->securitypriv.busetkipkey = 1; RT_TRACE(_module_rtl871x_security_c_, _drv_err_, - ("^^^rtw_use_tkipkey_handler23a padapter->securitypriv.busetkipkey =%d^^^\n", - padapter->securitypriv.busetkipkey)); + ("^^^%s padapter->securitypriv.busetkipkey =%d^^^\n", + __func__, padapter->securitypriv.busetkipkey)); }