Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756064AbbFOPBH (ORCPT ); Mon, 15 Jun 2015 11:01:07 -0400 Received: from mail-am1on0144.outbound.protection.outlook.com ([157.56.112.144]:51242 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755997AbbFOPAj convert rfc822-to-8bit (ORCPT ); Mon, 15 Jun 2015 11:00:39 -0400 From: "DHANAPAL, GNANACHANDRAN (G.)" To: "gregkh@linuxfoundation.org" CC: "mateusz.kulikowski@gmail.com" , "vthakkar1994@gmail.com" , "mdcasey@chabloom.com" , "kuleshovmail@gmail.com" , "mahati.chamarthy@gmail.com" , "lambert.quentin@gmail.com" , "kolbeinnkarls@gmail.com" , "joe@perches.com" , "himangi774@gmail.com" , "behanw@converseincode.com" , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH v2] Staging: rtl8192e: Timer setup using macro rather assignment Thread-Topic: [PATCH v2] Staging: rtl8192e: Timer setup using macro rather assignment Thread-Index: AQHQp3wIAGowPrJ21UGZpr0PIfeQtA== Date: Mon, 15 Jun 2015 15:00:34 +0000 Message-ID: <20150615143726.GA15323@visteon-gnana> Accept-Language: en-IN, ta-IN, ml-IN, te-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: linuxfoundation.org; dkim=none (message not signed) header.d=none; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [74.112.164.130] x-microsoft-exchange-diagnostics: 1;AM3PR06MB0855;3:Epuy7HVpdwaImzq+Egl4SURZ2we01rS5hP0h7BUQbIM0TQBy0K4WHftWajWu8E+AL9lf2Uijn6638Yccu/JsSCnPBlV0ajQmYxtRexKCEbGCAr6pASDMATbdmzVokHj13tFVDyBiAA0HgIWkBxalDg==;10:JPGWCa8Xlp7p3sfFxpWhWUfHdOcAfA1LjyGE4SwXy8JJNih7d7xmYE8VCDqBs9K1sJneLF9r92oyrpeoxkoXHxcfLtKxvO+DYlFXXRhYInM=;6:40iY/QvzedK5iKK7Vq6dt62N0KKlTwkhOc5ljy9uuy36fekH71obtjxY6MCcqq0b x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM3PR06MB0855;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM3PR06MB369; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(520003)(3002001);SRVR:AM3PR06MB0855;BCL:0;PCL:0;RULEID:;SRVR:AM3PR06MB0855; x-forefront-prvs: 0608DEDB67 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(33656002)(54356999)(50986999)(62966003)(46102003)(2501003)(106116001)(2351001)(189998001)(66066001)(2900100001)(40100003)(122556002)(5001960100002)(5001920100001)(110136002)(87936001)(77156002)(229853001)(102836002)(575784001)(77096005)(19580395003)(19580405001)(86362001)(5002640100001)(2656002)(33716001)(92566002);DIR:OUT;SFP:1102;SCL:1;SRVR:AM3PR06MB0855;H:AM3PR06MB0856.eurprd06.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:; Content-Type: text/plain; charset="us-ascii" Content-ID: <25B78DC8CE6B1043BA34BA5EBC960D1E@eurprd06.prod.outlook.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jun 2015 15:00:34.9299 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 7a147aaf-01ec-498c-80a1-e34a8c63c548 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR06MB0855 X-Microsoft-Exchange-Diagnostics: 1;AM3PR06MB369;2:OT7A1+of6XTRB78seENMyXBUCN9ZFz9mRldYIdEwmQIzFmx/0w8slCTkthUglM1f;2:CeypDA4aS6vBulshj3lc3CJ58AIirRzGnlzl56CmhfYiJN/RIWmXvcUuNgEpLYYVmfkrhhoI1i9OxTr96uyyCsI/yhDJV2yqzlYl58ErF1BJXnpqUOn9AJrLUS3XWuzGxqOji3RMX+OYlQXjcrycJg==;9:jstMO/V9QIRs23nD7VN5Y0jJVXkuw5JFPFkp1K6jQOXsWt590pRC90Q5jkFTwr7HXc4nL/12FgwruoLEMAcqbh4LfIB4AR4kQQjw3vNc8xWvO2XBjN21ULy6EHVRpwH74/saRlECWGUB0U3cDj3Jqg== X-OriginatorOrg: visteon.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5600 Lines: 157 This patch shall replaces user defined timer setup function with standard timer setup macro. Also removes init_timer, because timer can be initialized in setup_timer macro as well. Signed-off-by: Gnanachandran Dhanapal --- Addressed review comments from v1 1. setup_timer also subsumes init_timer. 2. Probably delete this function completely (_setup_timer) --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 -- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 1 - drivers/staging/rtl8192e/rtl819x_TS.h | 1 - drivers/staging/rtl8192e/rtl819x_TSProc.c | 18 +++++++++--------- drivers/staging/rtl8192e/rtllib_module.c | 6 ------ drivers/staging/rtl8192e/rtllib_softmac.c | 4 ++-- 6 files changed, 11 insertions(+), 21 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 4c53c87..5584b86 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -1275,12 +1275,10 @@ static short rtl8192_init(struct net_device *dev) init_hal_dm(dev); - init_timer(&priv->watch_dog_timer); setup_timer(&priv->watch_dog_timer, watch_dog_timer_callback, (unsigned long) dev); - init_timer(&priv->gpio_polling_timer); setup_timer(&priv->gpio_polling_timer, check_rfctrl_gpio_timer, (unsigned long)dev); diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c index 8532e0c..502a699 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c @@ -2180,7 +2180,6 @@ static void dm_init_fsync(struct net_device *dev) priv->rtllib->fsync_state = Default_Fsync; priv->framesyncMonitor = 1; - init_timer(&priv->fsync_timer); setup_timer(&priv->fsync_timer, dm_fsync_timer_callback, (unsigned long) dev); } diff --git a/drivers/staging/rtl8192e/rtl819x_TS.h b/drivers/staging/rtl8192e/rtl819x_TS.h index b3e721b..b8fed55 100644 --- a/drivers/staging/rtl8192e/rtl819x_TS.h +++ b/drivers/staging/rtl8192e/rtl819x_TS.h @@ -67,7 +67,6 @@ struct rx_ts_record { u8 num; }; -void _setup_timer(struct timer_list *, void *, unsigned long); #endif diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c index 8a5dd6e..05aea43 100644 --- a/drivers/staging/rtl8192e/rtl819x_TSProc.c +++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c @@ -154,22 +154,22 @@ void TSInitialize(struct rtllib_device *ieee) for (count = 0; count < TOTAL_TS_NUM; count++) { pTxTS->num = count; - _setup_timer(&pTxTS->TsCommonInfo.SetupTimer, + setup_timer(&pTxTS->TsCommonInfo.SetupTimer, TsSetupTimeOut, (unsigned long) pTxTS); - _setup_timer(&pTxTS->TsCommonInfo.InactTimer, + setup_timer(&pTxTS->TsCommonInfo.InactTimer, TsInactTimeout, (unsigned long) pTxTS); - _setup_timer(&pTxTS->TsAddBaTimer, + setup_timer(&pTxTS->TsAddBaTimer, TsAddBaProcess, (unsigned long) pTxTS); - _setup_timer(&pTxTS->TxPendingBARecord.Timer, + setup_timer(&pTxTS->TxPendingBARecord.Timer, BaSetupTimeOut, (unsigned long) pTxTS); - _setup_timer(&pTxTS->TxAdmittedBARecord.Timer, + setup_timer(&pTxTS->TxAdmittedBARecord.Timer, TxBaInactTimeout, (unsigned long) pTxTS); @@ -186,19 +186,19 @@ void TSInitialize(struct rtllib_device *ieee) pRxTS->num = count; INIT_LIST_HEAD(&pRxTS->RxPendingPktList); - _setup_timer(&pRxTS->TsCommonInfo.SetupTimer, + setup_timer(&pRxTS->TsCommonInfo.SetupTimer, TsSetupTimeOut, (unsigned long) pRxTS); - _setup_timer(&pRxTS->TsCommonInfo.InactTimer, + setup_timer(&pRxTS->TsCommonInfo.InactTimer, TsInactTimeout, (unsigned long) pRxTS); - _setup_timer(&pRxTS->RxAdmittedBARecord.Timer, + setup_timer(&pRxTS->RxAdmittedBARecord.Timer, RxBaInactTimeout, (unsigned long) pRxTS); - _setup_timer(&pRxTS->RxPktPendingTimer, + setup_timer(&pRxTS->RxPktPendingTimer, RxPktPendingTimeout, (unsigned long) pRxTS); diff --git a/drivers/staging/rtl8192e/rtllib_module.c b/drivers/staging/rtl8192e/rtllib_module.c index 845d9b8..7704177 100644 --- a/drivers/staging/rtl8192e/rtllib_module.c +++ b/drivers/staging/rtl8192e/rtllib_module.c @@ -57,12 +57,6 @@ u32 rt_global_debug_component = COMP_ERR; EXPORT_SYMBOL(rt_global_debug_component); -void _setup_timer(struct timer_list *ptimer, void *fun, unsigned long data) -{ - ptimer->function = fun; - ptimer->data = data; - init_timer(ptimer); -} static inline int rtllib_networks_allocate(struct rtllib_device *ieee) { diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 7ce58e2..6341a83 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -3127,11 +3127,11 @@ void rtllib_softmac_init(struct rtllib_device *ieee) ieee->enable_rx_imm_BA = true; ieee->tx_pending.txb = NULL; - _setup_timer(&ieee->associate_timer, + setup_timer(&ieee->associate_timer, rtllib_associate_abort_cb, (unsigned long) ieee); - _setup_timer(&ieee->beacon_timer, + setup_timer(&ieee->beacon_timer, rtllib_send_beacon_cb, (unsigned long) ieee); -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/