From patchwork Mon Dec 28 13:48:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Safonov X-Patchwork-Id: 7926101 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 DEA609F349 for ; Mon, 28 Dec 2015 13:47:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 106D720263 for ; Mon, 28 Dec 2015 13:47:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3F6DC20253 for ; Mon, 28 Dec 2015 13:47:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752232AbbL1Nq6 (ORCPT ); Mon, 28 Dec 2015 08:46:58 -0500 Received: from mail-lf0-f50.google.com ([209.85.215.50]:34432 "EHLO mail-lf0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751598AbbL1Nq4 (ORCPT ); Mon, 28 Dec 2015 08:46:56 -0500 Received: by mail-lf0-f50.google.com with SMTP id y184so198268815lfc.1; Mon, 28 Dec 2015 05:46:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=Ca8fs4sqCzjI6KsJow9rTZiwnxImdveUQJCtqKgbV7Y=; b=N0SZF3ALxw9EbnsLhHuBLoBwAOlvAxc2j2PEX9MYsJGHoELXSY0GVMyI+Lv7JXZXWJ nd5opYTUP+yoc3nmEHIKuLi6lpqD9Japl46hA2+/11Mu5AAD/p1naY27BZKvx7ifMclD T9UrrxX0EX+oWDsDLcpFG3rS9DS3JlZmwu/h8MPIMxUC57yRqvxTUb24zT95Lc7EX2Ov FEqgXvRlhrQ7fF9fU5yRD/OKAmFEIr86AOk+GmS3Osi4txt3NA9gSjGEsch+OIiNnBf+ iDF+vjfkhkC9Orqeyg0X5mZWbz/ryCffZq1fTEwLCFZ3wZ2/BOtW5YdmF/TEiHjincpC cjxQ== X-Received: by 10.25.143.14 with SMTP id r14mr19213738lfd.71.1451310414882; Mon, 28 Dec 2015 05:46:54 -0800 (PST) Received: from alpha ([193.218.138.55]) by smtp.gmail.com with ESMTPSA id p1sm8112799lbo.30.2015.12.28.05.46.53 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 28 Dec 2015 05:46:54 -0800 (PST) Received: (nullmailer pid 10576 invoked by uid 1000); Mon, 28 Dec 2015 13:48:52 -0000 Date: Mon, 28 Dec 2015 20:48:52 +0700 From: Ivan Safonov To: QCA ath9k Development Cc: Kalle Valo , linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] /drivers/net/wireless/ath/ath9k remove unnecessary ?: operator Message-ID: <20151228134852.GA10572@alpha.sfu-kras.ru> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) 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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 ((thermometer < 0) ? 0 : (thermometer == X)) and (thermometer == X) are equal for X >= 0. Signed-off-by: Ivan Safonov --- drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index 8b4561e..35e57f7 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c @@ -4097,16 +4097,16 @@ static void ar9003_hw_thermometer_apply(struct ath_hw *ah) REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX4, AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR, therm_on); - therm_on = (thermometer < 0) ? 0 : (thermometer == 0); + therm_on = thermometer == 0; REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_RXTX4, AR_PHY_65NM_CH0_RXTX4_THERM_ON, therm_on); if (pCap->chip_chainmask & BIT(1)) { - therm_on = (thermometer < 0) ? 0 : (thermometer == 1); + therm_on = thermometer == 1; REG_RMW_FIELD(ah, AR_PHY_65NM_CH1_RXTX4, AR_PHY_65NM_CH0_RXTX4_THERM_ON, therm_on); } if (pCap->chip_chainmask & BIT(2)) { - therm_on = (thermometer < 0) ? 0 : (thermometer == 2); + therm_on = thermometer == 2; REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX4, AR_PHY_65NM_CH0_RXTX4_THERM_ON, therm_on); } From patchwork Fri Jan 1 12:03:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 7938951 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DDDC8BEEE5 for ; Fri, 1 Jan 2016 12:04:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1E5DE20529 for ; Fri, 1 Jan 2016 12:04:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4FF7E201BB for ; Fri, 1 Jan 2016 12:04:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751750AbcAAMEZ (ORCPT ); Fri, 1 Jan 2016 07:04:25 -0500 Received: from m50-135.163.com ([123.125.50.135]:58224 "EHLO m50-135.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751476AbcAAMEX (ORCPT ); Fri, 1 Jan 2016 07:04:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=gBdo6GsgF2ioUjJRZh 7ya6dNRKiOe454nZY7lMk3xp4=; b=NAPQA7Nz+tMic+hd13MOvK+duBS3SpnuGz XhoG/36c0+fl/hmE4H21nK66qdAQZN0UIxr55PwyCpqnXKOx6svZtP09al78twIh hWCIfU7x35inZm1Wv2I21EtBvZA+Vn1h4mdkho84Q+2XXIl5i7tWNTP10yKG1tvK I6eHDiWJg= Received: from localhost (unknown [116.77.129.183]) by smtp5 (Coremail) with SMTP id D9GowADHCNQja4ZWCEjeCQ--.45547S3; Fri, 01 Jan 2016 20:03:49 +0800 (CST) From: Geliang Tang To: Stanislav Yakovlev , Kalle Valo Cc: Geliang Tang , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] ipw2x00: use to_pci_dev() Date: Fri, 1 Jan 2016 20:03:43 +0800 Message-Id: X-Mailer: git-send-email 2.5.0 X-CM-TRANSID: D9GowADHCNQja4ZWCEjeCQ--.45547S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7XFWxJFyxtry8urW7WFWkCrg_yoWfWrX_Zr nFyFs7XryrJ3WF9r43CrWIyryjka40qw48WrZ7try5Ka1fZr4DCr98Zry2qFWFgr1DAryY yrn7GF1rCrZ0kjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUbJUUUUUUUU== X-Originating-IP: [116.77.129.183] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/1tbiMAbimVWBTeX9ywAAsH 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Use to_pci_dev() instead of open-coding it. Signed-off-by: Geliang Tang --- This patch is against net-next tree. Changes in v2: - fix wrong title. --- drivers/net/wireless/intel/ipw2x00/ipw2100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2100.c b/drivers/net/wireless/intel/ipw2x00/ipw2100.c index 36818c7..121294f 100644 --- a/drivers/net/wireless/intel/ipw2x00/ipw2100.c +++ b/drivers/net/wireless/intel/ipw2x00/ipw2100.c @@ -3514,7 +3514,7 @@ static void ipw2100_msg_free(struct ipw2100_priv *priv) static ssize_t show_pci(struct device *d, struct device_attribute *attr, char *buf) { - struct pci_dev *pci_dev = container_of(d, struct pci_dev, dev); + struct pci_dev *pci_dev = to_pci_dev(d); char *out = buf; int i, j; u32 val; From patchwork Fri Jan 1 15:48:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 7939651 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 15E579F350 for ; Fri, 1 Jan 2016 15:50:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1872220225 for ; Fri, 1 Jan 2016 15:50:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ED0D72012B for ; Fri, 1 Jan 2016 15:50:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752036AbcAAPtc (ORCPT ); Fri, 1 Jan 2016 10:49:32 -0500 Received: from m50-135.163.com ([123.125.50.135]:51543 "EHLO m50-135.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751737AbcAAPta (ORCPT ); Fri, 1 Jan 2016 10:49:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=LtjA5JC53zP5nU6FDJ /u0b6jsx+ndgiIXyY735nt+9o=; b=Gn3pJ1MQsVohCRAqFN12tJquc3PblCky1x kHrGbbKXE8v4aQ5XMsKM/flD7ci62/s5LboZsM4hL9j+7w6VfdUH4Kf0E4iELJJm zyD6RcEqPEFN0GrJGM66CF7AV+MSNmZyO0tSfZqUU1fb+ak9GYzfwRBEosOjsdbP NJQaz+FQo= Received: from localhost (unknown [116.77.129.183]) by smtp5 (Coremail) with SMTP id D9GowABnr6vyn4ZWzfzpCQ--.47721S3; Fri, 01 Jan 2016 23:49:07 +0800 (CST) From: Geliang Tang To: Kalle Valo , Eliad Peller , Kobi Leibovitch Cc: Geliang Tang , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/6] wlcore: use to_delayed_work Date: Fri, 1 Jan 2016 23:48:53 +0800 Message-Id: <7e3f7f2de228014b7039a935f16478e9ab8a05e5.1451661580.git.geliangtang@163.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <5df0633bd7779dd21192f7a41c634efd78f8606c.1451661580.git.geliangtang@163.com> References: <5df0633bd7779dd21192f7a41c634efd78f8606c.1451661580.git.geliangtang@163.com> In-Reply-To: <5df0633bd7779dd21192f7a41c634efd78f8606c.1451661580.git.geliangtang@163.com> References: <5df0633bd7779dd21192f7a41c634efd78f8606c.1451661580.git.geliangtang@163.com> X-CM-TRANSID: D9GowABnr6vyn4ZWzfzpCQ--.47721S3 X-Coremail-Antispam: 1Uf129KBjvJXoWxCw18Xw4ktrWrCFWfuFW3ZFb_yoW5urykpF Z8Ja4fCw4UWa1qgr4rXFWrZF1fK3WqkF9Fgr4rGa4Fyrn7Ary5GFn5XFy2yFW5CrWrCay7 ZrWYvr4xJFsYyrDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07U2Ap5UUUUU= X-Originating-IP: [116.77.129.183] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/xtbByhPimVO+g7HTOgAAsU 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Use to_delayed_work() instead of open-coding it. Signed-off-by: Geliang Tang --- drivers/net/wireless/ti/wlcore/main.c | 10 +++++----- drivers/net/wireless/ti/wlcore/ps.c | 2 +- drivers/net/wireless/ti/wlcore/scan.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index ec7f6af..5c12caa 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -244,7 +244,7 @@ static void wl12xx_tx_watchdog_work(struct work_struct *work) struct delayed_work *dwork; struct wl1271 *wl; - dwork = container_of(work, struct delayed_work, work); + dwork = to_delayed_work(work); wl = container_of(dwork, struct wl1271, tx_watchdog_work); mutex_lock(&wl->mutex); @@ -2085,7 +2085,7 @@ static void wlcore_channel_switch_work(struct work_struct *work) struct wl12xx_vif *wlvif; int ret; - dwork = container_of(work, struct delayed_work, work); + dwork = to_delayed_work(work); wlvif = container_of(dwork, struct wl12xx_vif, channel_switch_work); wl = wlvif->wl; @@ -2121,7 +2121,7 @@ static void wlcore_connection_loss_work(struct work_struct *work) struct ieee80211_vif *vif; struct wl12xx_vif *wlvif; - dwork = container_of(work, struct delayed_work, work); + dwork = to_delayed_work(work); wlvif = container_of(dwork, struct wl12xx_vif, connection_loss_work); wl = wlvif->wl; @@ -2150,7 +2150,7 @@ static void wlcore_pending_auth_complete_work(struct work_struct *work) unsigned long time_spare; int ret; - dwork = container_of(work, struct delayed_work, work); + dwork = to_delayed_work(work); wlvif = container_of(dwork, struct wl12xx_vif, pending_auth_complete_work); wl = wlvif->wl; @@ -5660,7 +5660,7 @@ static void wlcore_roc_complete_work(struct work_struct *work) struct wl1271 *wl; int ret; - dwork = container_of(work, struct delayed_work, work); + dwork = to_delayed_work(work); wl = container_of(dwork, struct wl1271, roc_complete_work); ret = wlcore_roc_completed(wl); diff --git a/drivers/net/wireless/ti/wlcore/ps.c b/drivers/net/wireless/ti/wlcore/ps.c index 4cd316e..d4420da 100644 --- a/drivers/net/wireless/ti/wlcore/ps.c +++ b/drivers/net/wireless/ti/wlcore/ps.c @@ -38,7 +38,7 @@ void wl1271_elp_work(struct work_struct *work) struct wl12xx_vif *wlvif; int ret; - dwork = container_of(work, struct delayed_work, work); + dwork = to_delayed_work(work); wl = container_of(dwork, struct wl1271, elp_work); wl1271_debug(DEBUG_PSM, "elp work"); diff --git a/drivers/net/wireless/ti/wlcore/scan.c b/drivers/net/wireless/ti/wlcore/scan.c index 1e3d51c..a384f3f 100644 --- a/drivers/net/wireless/ti/wlcore/scan.c +++ b/drivers/net/wireless/ti/wlcore/scan.c @@ -38,7 +38,7 @@ void wl1271_scan_complete_work(struct work_struct *work) struct wl12xx_vif *wlvif; int ret; - dwork = container_of(work, struct delayed_work, work); + dwork = to_delayed_work(work); wl = container_of(dwork, struct wl1271, scan_complete_work); wl1271_debug(DEBUG_SCAN, "Scanning complete"); From patchwork Fri Jan 1 15:48:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 7939751 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8EBB7BEEE5 for ; Fri, 1 Jan 2016 15:52:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D1B4C20225 for ; Fri, 1 Jan 2016 15:52:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 085292012E for ; Fri, 1 Jan 2016 15:52:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752112AbcAAPul (ORCPT ); Fri, 1 Jan 2016 10:50:41 -0500 Received: from m50-134.163.com ([123.125.50.134]:57128 "EHLO m50-134.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752052AbcAAPtg (ORCPT ); Fri, 1 Jan 2016 10:49:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=XjY0S9rWhydV9qPiSq Cg25x5c+kXXUINP18QQv78mSc=; b=BS66ofn1iuJC7zmU5yw2NXyF51+NMRQw4A 1IlDKNc/CrG0W7j03drvYQMilg4whxoY01wPUZ55u5esP2BjjBMmiKGk85GNO6tM aSF+kKME/T4WtF4OIAS6txGe/gMIQsvRWTEUSDWVN2GZvCjxH1dBn/69Wf844zGQ DLnzjwqV0= Received: from localhost (unknown [116.77.129.183]) by smtp4 (Coremail) with SMTP id DtGowEDZekf5n4ZWEjUUAA--.9125S3; Fri, 01 Jan 2016 23:49:13 +0800 (CST) From: Geliang Tang To: Kalle Valo Cc: Geliang Tang , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/6] wl1251: use to_delayed_work Date: Fri, 1 Jan 2016 23:48:54 +0800 Message-Id: <9a028ab8d643492c36d42d9d89d212471d12f966.1451661580.git.geliangtang@163.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <5df0633bd7779dd21192f7a41c634efd78f8606c.1451661580.git.geliangtang@163.com> References: <5df0633bd7779dd21192f7a41c634efd78f8606c.1451661580.git.geliangtang@163.com> In-Reply-To: <5df0633bd7779dd21192f7a41c634efd78f8606c.1451661580.git.geliangtang@163.com> References: <5df0633bd7779dd21192f7a41c634efd78f8606c.1451661580.git.geliangtang@163.com> X-CM-TRANSID: DtGowEDZekf5n4ZWEjUUAA--.9125S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7Gw1xAF48Gw4UKr4kKryDWrg_yoW3XrX_ur WIvFs2g340k34rKrWY9F4fA3yFy34kuFn5GrsIva98Za1UZrWUGFW5Zr9rJry8Gr4xuF13 W3sxJF4UC39rAjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUUaL9UUUUUU== X-Originating-IP: [116.77.129.183] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/1tbiNRrimVSILKcHtwAAsz 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Use to_delayed_work() instead of open-coding it. Signed-off-by: Geliang Tang --- drivers/net/wireless/ti/wl1251/ps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ti/wl1251/ps.c b/drivers/net/wireless/ti/wl1251/ps.c index b9e27b9..fa01b0a 100644 --- a/drivers/net/wireless/ti/wl1251/ps.c +++ b/drivers/net/wireless/ti/wl1251/ps.c @@ -32,7 +32,7 @@ void wl1251_elp_work(struct work_struct *work) struct delayed_work *dwork; struct wl1251 *wl; - dwork = container_of(work, struct delayed_work, work); + dwork = to_delayed_work(work); wl = container_of(dwork, struct wl1251, elp_work); wl1251_debug(DEBUG_PSM, "elp work"); From patchwork Fri Jan 1 15:48:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 7939691 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 E4A559F88A for ; Fri, 1 Jan 2016 15:51:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1CC9820225 for ; Fri, 1 Jan 2016 15:51:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 152D320373 for ; Fri, 1 Jan 2016 15:51:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752206AbcAAPus (ORCPT ); Fri, 1 Jan 2016 10:50:48 -0500 Received: from m50-133.163.com ([123.125.50.133]:44020 "EHLO m50-133.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752057AbcAAPt4 (ORCPT ); Fri, 1 Jan 2016 10:49:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=DRo2jUQhKL7jqVywR0 nJlvuyQd9cbeDPBkV4hj0d3pc=; b=ZCu3Qigy6OONsxBCBfZoxYQwACAfQkOPoj lz9Fy19ag2zyz/FrAPoWNZAbR2yvJ/PY9/JOP05A8na47x+syRfjitTI+YcuT5Sy pkbJfiZ5tWLCWKN3oN28Qlm+x7KmD1zs+FG7z4x1AWDc2ITyDTM+iSpRByXLTLg6 8vmRdMqmU= Received: from localhost (unknown [116.77.129.183]) by smtp3 (Coremail) with SMTP id DdGowEC5IUUBoIZW9aSXAA--.4012S3; Fri, 01 Jan 2016 23:49:22 +0800 (CST) From: Geliang Tang To: Larry Finger , Chaoming Li , Kalle Valo Cc: Geliang Tang , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/6] rtlwifi: use to_delayed_work Date: Fri, 1 Jan 2016 23:48:55 +0800 Message-Id: <9453f5a6fe422f47b095d1b0a9fb5eb5a4935c4d.1451661580.git.geliangtang@163.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <5df0633bd7779dd21192f7a41c634efd78f8606c.1451661580.git.geliangtang@163.com> References: <5df0633bd7779dd21192f7a41c634efd78f8606c.1451661580.git.geliangtang@163.com> In-Reply-To: <5df0633bd7779dd21192f7a41c634efd78f8606c.1451661580.git.geliangtang@163.com> References: <5df0633bd7779dd21192f7a41c634efd78f8606c.1451661580.git.geliangtang@163.com> X-CM-TRANSID: DdGowEC5IUUBoIZW9aSXAA--.4012S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7Gw1xAF48Gw4Utr4fJw4DXFb_yoW3trc_ur W0qF4fu3WrK34xKFZ8AFW3Z3yjy3yDZr1kGa92qFW7Jr43ZrWjyryFvry7Jr1rWr17Arnx Crn8JF18C345AjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUj8nY7UUUUU== X-Originating-IP: [116.77.129.183] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/1tbivwPimVWBPXQ+BQAAsh 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Use to_delayed_work() instead of open-coding it. Signed-off-by: Geliang Tang --- drivers/net/wireless/realtek/rtlwifi/wifi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/wifi.h b/drivers/net/wireless/realtek/rtlwifi/wifi.h index 4544752..d37ce16 100644 --- a/drivers/net/wireless/realtek/rtlwifi/wifi.h +++ b/drivers/net/wireless/realtek/rtlwifi/wifi.h @@ -2873,7 +2873,7 @@ value to host byte ordering.*/ (ppsc->cur_ps_level |= _ps_flg) #define container_of_dwork_rtl(x, y, z) \ - container_of(container_of(x, struct delayed_work, work), y, z) + container_of(to_delayed_work(x), y, z) #define FILL_OCTET_STRING(_os, _octet, _len) \ (_os).octet = (u8 *)(_octet); \ From patchwork Fri Jan 1 15:48:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 7939701 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 0769C9F350 for ; Fri, 1 Jan 2016 15:51:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3AF1620225 for ; Fri, 1 Jan 2016 15:51:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1E424202BE for ; Fri, 1 Jan 2016 15:51:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752223AbcAAPuv (ORCPT ); Fri, 1 Jan 2016 10:50:51 -0500 Received: from m50-132.163.com ([123.125.50.132]:49041 "EHLO m50-132.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752059AbcAAPuE (ORCPT ); Fri, 1 Jan 2016 10:50:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=bt4RkzpU0MrJrLvcpr 6NfcUfXD3HdzZVeuP6TQ/QhiM=; b=XiawyTe3H7ciHNa2r9SxaTAoxWtr/u4Pqp epjNzJpRrUo2TCSBBh0hEZh0ckkPmVN2t3gEkxl/5ZYNX2yVOgedLo03dZKJshgO YPiHEXMCp053MaUg2X4ZwnJ9OsIDu6j8bmtWqoNe9qywVR7QUmWZR4de2EZSvt8R sgXsraClE= Received: from localhost (unknown [116.77.129.183]) by smtp2 (Coremail) with SMTP id DNGowEAp0EYJoIZWwu5PAA--.36337S3; Fri, 01 Jan 2016 23:49:29 +0800 (CST) From: Geliang Tang To: Amitkumar Karwar , Nishant Sarmukadam , Kalle Valo Cc: Geliang Tang , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/6] mwifiex: use to_delayed_work Date: Fri, 1 Jan 2016 23:48:56 +0800 Message-Id: <2ae1e4a43ac4e78a747ffd52320ca4c7c275a4a7.1451661580.git.geliangtang@163.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <5df0633bd7779dd21192f7a41c634efd78f8606c.1451661580.git.geliangtang@163.com> References: <5df0633bd7779dd21192f7a41c634efd78f8606c.1451661580.git.geliangtang@163.com> In-Reply-To: <5df0633bd7779dd21192f7a41c634efd78f8606c.1451661580.git.geliangtang@163.com> References: <5df0633bd7779dd21192f7a41c634efd78f8606c.1451661580.git.geliangtang@163.com> X-CM-TRANSID: DNGowEAp0EYJoIZWwu5PAA--.36337S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7KFWxJrWrKF47ur4xWFyDKFg_yoW8Gw4DpF Z8A34v93y8Xw1UCr45XF48ZF15KF1vg34Ikws2y3yfGrnakw15WF15KFyFkF45Wr4kuw1a vr4jqryxZFn7KrDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07U7uc_UUUUU= X-Originating-IP: [116.77.129.183] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/xtbBygrimVO+g7HUMQAAsB 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Use to_delayed_work() instead of open-coding it. Signed-off-by: Geliang Tang --- drivers/net/wireless/marvell/mwifiex/11h.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/11h.c b/drivers/net/wireless/marvell/mwifiex/11h.c index 71a1b58..81c60d0 100644 --- a/drivers/net/wireless/marvell/mwifiex/11h.c +++ b/drivers/net/wireless/marvell/mwifiex/11h.c @@ -123,8 +123,7 @@ void mwifiex_11h_process_join(struct mwifiex_private *priv, u8 **buffer, void mwifiex_dfs_cac_work_queue(struct work_struct *work) { struct cfg80211_chan_def chandef; - struct delayed_work *delayed_work = - container_of(work, struct delayed_work, work); + struct delayed_work *delayed_work = to_delayed_work(work); struct mwifiex_private *priv = container_of(delayed_work, struct mwifiex_private, dfs_cac_work); @@ -289,8 +288,7 @@ int mwifiex_11h_handle_radar_detected(struct mwifiex_private *priv, void mwifiex_dfs_chan_sw_work_queue(struct work_struct *work) { struct mwifiex_uap_bss_param *bss_cfg; - struct delayed_work *delayed_work = - container_of(work, struct delayed_work, work); + struct delayed_work *delayed_work = to_delayed_work(work); struct mwifiex_private *priv = container_of(delayed_work, struct mwifiex_private, dfs_chan_sw_work); From patchwork Fri Jan 1 18:23:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 7939861 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 2D14D9F387 for ; Fri, 1 Jan 2016 18:24:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5042C20412 for ; Fri, 1 Jan 2016 18:24:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 712D8203F7 for ; Fri, 1 Jan 2016 18:24:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752256AbcAASXr (ORCPT ); Fri, 1 Jan 2016 13:23:47 -0500 Received: from mout.web.de ([212.227.17.12]:52085 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752102AbcAASXp (ORCPT ); Fri, 1 Jan 2016 13:23:45 -0500 Received: from [192.168.1.2] ([77.182.63.9]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0MORiL-1aIerp3TBF-005oDx; Fri, 01 Jan 2016 19:23:41 +0100 Subject: [PATCH 1/2] net-ath9k_htc: Delete an unnecessary variable initialisation in ath9k_hif_usb_rx_stream() To: ath9k-devel@lists.ath9k.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, ath9k-devel@qca.qualcomm.com, Kalle Valo References: <566ABCD9.1060404@users.sourceforge.net> <5686C390.5060600@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <5686C42A.5000405@users.sourceforge.net> Date: Fri, 1 Jan 2016 19:23:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <5686C390.5060600@users.sourceforge.net> X-Provags-ID: V03:K0:xBG6/FWwG5iA28tkEZn0auKM0/g4x6e5Z/6uH/tstFm0GSxjFod qikCcEfqqItu1NER5M5xO4/3u2LqZtAb7stR1tRdDPxgdTdDj13l5c555Imd8xPso3iPOd5 qHD3ApxWmeORA4Ep6TR1DjIP4ZnxWSExwaMQE75pzZCPYMJpd5g3irCQCJfcMa0sHMh6G33 icK58DWSEulzWUPWB42IQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:HPTZ9BjOWSI=:wcmxZUIXJKgFL8APalAV6L uLhChh7nyvaEcHzl+WRqXHsxV2gonFiO26t9rM/WRXeEsuT1RiRj+8Bm2OvmzwCYKp2hEECGx cxoN6bRLG1F8xW21ZESJteLmDPcoF0k2P5fi/dWeaflFepTWf271kJvRt6hQFEHTum20zjWMq etowlg+Jf2rw9Pr0PIV40Se9Zyoq7IM0JUp+rE1VgF6w/ZZkh8Gr0km6qvVHGOrinKMpcQIzJ QhZSopJqnyPmkg2Hyz5fWVkWPpFKUsGRKmDoWV4CLoPwx1sPQfpcvOIg6uL1GImysGSaF4tbi uGcaGN7pTdOnfQTafytjPysk18Sv/iYg01CjwX7Bcs3yHIY13NlnWFoq5JCbBiwknKPmU1jNy IuRrNxYd76bXYOcAIKpv17DhTT8V91B65uyjndICyHG7creaUxAsM2RJWH1lHOk0qnB7ivI8F LSIxXVcktKPgwBHr0vTgrxfSW86BHnjvABP3V41hsD7yBDQ3iWTXpdhO8y4GtGHsJ6EqLetBP p7PMMwEFRwf7hCcS4W98VzCKrvR6bVWtyw4uWxwomIxv5B9QLC7LdkMEL02HKUn5jtGBnpH6J 17PT/Kwml4coGuniCiOXC/DRPPUZwz6BAyfwbJ3fcDCc8NKq4QcOAkAuVwlm4UPlBTBbzOmUe hFXYtBvFK3ipQKlnic6lFE0F/C1diIKFtzEKWDGhEMTzLC/2Tuds8sBQmqrgjKBESqPwNRVrJ Avia9PZ4zZ8NCG+LZGtnLWUD35re0cDRWeFOj1dSsR8DtX8N5vqGILG7fY3iInGUJZ1JEi+GS Rtg57WR 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, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 From: Markus Elfring Date: Fri, 1 Jan 2016 19:00:53 +0100 Omit explicit initialisation at the beginning for one local variable that is redefined before its first use. Signed-off-by: Markus Elfring Reviewed-by: Oleksij Rempel --- drivers/net/wireless/ath/ath9k/hif_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index 165dd20..51bd61b 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c @@ -525,7 +525,7 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev, struct sk_buff *skb) { struct sk_buff *nskb, *skb_pool[MAX_PKT_NUM_IN_TRANSFER]; - int index = 0, i = 0, len = skb->len; + int index = 0, i, len = skb->len; int rx_remain_len, rx_pkt_len; u16 pool_index = 0; u8 *ptr; From patchwork Fri Jan 1 19:26:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 7939951 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 C2DAC9F38D for ; Fri, 1 Jan 2016 19:27:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DF53F20520 for ; Fri, 1 Jan 2016 19:27:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2418B20515 for ; Fri, 1 Jan 2016 19:27:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752186AbcAAT0m (ORCPT ); Fri, 1 Jan 2016 14:26:42 -0500 Received: from mout.web.de ([212.227.15.4]:50380 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752156AbcAAT0k (ORCPT ); Fri, 1 Jan 2016 14:26:40 -0500 Received: from [192.168.1.2] ([77.182.63.9]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0MSJH1-1ahNh104M7-00TSjh; Fri, 01 Jan 2016 20:26:28 +0100 Subject: [PATCH] net-brcmfmac: Delete an unnecessary variable initialisation in brcmf_sdio_download_firmware() References: <566ABCD9.1060404@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall To: brcm80211-dev-list@broadcom.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Arend van Spriel , Brett Rudley , "Franky (Zhenhui) Lin" , Hante Meuleman , Kalle Valo From: SF Markus Elfring Message-ID: <5686D2E0.2010309@users.sourceforge.net> Date: Fri, 1 Jan 2016 20:26:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <566ABCD9.1060404@users.sourceforge.net> X-Provags-ID: V03:K0:I8qv48DU50KDuB+/pw3paxmx7HJGOIgB2n9+3X9tF5VhK/8fS+d Ufa73p1i1AdJT+PlyBSB+bMstebvxie7ZEu57bxMZ61Fy4RRgHql2hOk2yxjEg9BjaomEt6 WBTi63QEBLnqq4Sn0kLPlXL/1AQYaRLmbQKv4aCF7dnJ53Dj04gHqgO2Vf/cO2tL1Kw5jaS jTMS79ZKHbfWO0F3CaqBg== X-UI-Out-Filterresults: notjunk:1; V01:K0:rMe7LWTlf00=:b6f43pO/yEWDZTVhwaTqoR eo2cFhgRapEGTwWqzDwJ4QgmJ5CkHKr3GS6p0eKfubZP96SHMMcnSUL6cncEftlDQuQc0eX0C xKgtcIYiBj9LoPjbYw3jKgdIAMH75FDvAM7JYIMIsFSWb4+35QX/dSKNeNEogwWIF9nyHXE71 bdrtNl3jQl+dmnBE37E1Ukc/ejHF2zHWAMMxf5c+yFWy3GllMTNkpv1N2E2NaQTzMmXY7KzER e5m9zvTYp0SLbSfBHoibgSvrvs20ofcEhN7/EyPD25xgzCMnM2+3TjVeyge6p81boi0VXlUD/ 7bBLnk7qgBnixb+5NTYl9b3+Xltl7M5UmlJN/0Y5XwVYpPCfrw+Vv6LTVYPQG7dkHJbJFSPCU 5vwo43zOPjZe2AJxS2szK1RhJuk3Ht6iV5ToxphOaq2I13jZRz8Q7z4aIS7+YCrpDM9E9D++y SbYNkWNubauGvV6Ilnuk9cHBqRKzpbRxyQwwU0llUZrbM5TqQQjFBllsGO2xDYINPMZWvJMql NfJs9dYSvxEFekf7K7KAScXtu+sJkgbXha5k8igWiIYtUXzWyBGMii1x9JKwtDMBrCztsLPpq +BEZHpcU51fiYbuDhoO1Knboj8NTJ8sm6HLOq9pXTFT5rNT1WT4NC53uKQSrPaKwl8dTktWSw XF30fiF+FoL9V6CqC752C+Kuiw6W104jDr+xAU2Duzl3EPhbZ8aUm97Q5w0SEp6gng66bLVvz SdV75gP+/QEJSur4T/bdtBpS+M2lsLye5YWaWozGJXDIDuiA2XGGfjoKxh4sg8YVyEbRCl5DI 0xH8vSM 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, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 From: Markus Elfring Date: Fri, 1 Jan 2016 20:20:15 +0100 Omit explicit initialisation at the beginning for one local variable that is redefined before its first use. Signed-off-by: Markus Elfring Acked-by: Arend van Spriel --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index ceb2a75..c21eeb1 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -3260,7 +3260,7 @@ static int brcmf_sdio_download_firmware(struct brcmf_sdio *bus, const struct firmware *fw, void *nvram, u32 nvlen) { - int bcmerror = -EFAULT; + int bcmerror; u32 rstvec; sdio_claim_host(bus->sdiodev->func[1]); From patchwork Fri Jan 1 20:30:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 7939981 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 7B2879F350 for ; Fri, 1 Jan 2016 20:30:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A75FA204FF for ; Fri, 1 Jan 2016 20:30:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CC0802011D for ; Fri, 1 Jan 2016 20:30:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752413AbcAAUaZ (ORCPT ); Fri, 1 Jan 2016 15:30:25 -0500 Received: from mout.web.de ([212.227.17.11]:64129 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752263AbcAAUaY (ORCPT ); Fri, 1 Jan 2016 15:30:24 -0500 Received: from [192.168.1.2] ([77.182.63.9]) by smtp.web.de (mrweb102) with ESMTPSA (Nemesis) id 0MHp8z-1aGUJf27CP-003cHW; Fri, 01 Jan 2016 21:30:14 +0100 Subject: [PATCH 1/3] net-iwlegacy: Refactoring for il_eeprom_init() To: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Kalle Valo , Stanislaw Gruszka References: <566ABCD9.1060404@users.sourceforge.net> <5686E13F.2010309@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <5686E1D2.60107@users.sourceforge.net> Date: Fri, 1 Jan 2016 21:30:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <5686E13F.2010309@users.sourceforge.net> X-Provags-ID: V03:K0:5jETzftjRIn3JI87XtOVZvpcVu0xuo9jUIeeUYeBtGI1H86j9/A mo9UPotzHyf+sFsRHZuqhFRLscEzIBXhBSAagXqVX+0/96sNWypucY+i8qeeXcKBFkPSx2q h13bg5B6ug7GlIpmL6U9r/3kZqOHeZ9v6WSrnE/yrYpQbHEJjIzS4RgJnXS4ehOlGR8BtTE RtKQxQPlF7IbFcxbtiOTg== X-UI-Out-Filterresults: notjunk:1; V01:K0:dUmQOzi4+yY=:6uIvgi6I6WgxguSAYrcccp MVxlqrVEHzZSTXwhn8OuHAe7tvK4wdVdCm2v3M6D0/UmpS9HzcK7cz3Hh2MiLfVbiAdMnHL21 Ixm6oMGhQbJBpEJ8AucHdkKjVmU0eS51wZRMyLZmd2PrgoazgznBBhm/pKEbrzte+AxB9D121 /aGgx2+TNkRDvuSQv9yJyNfLRgji3kJHz3cYYg+V9HJY1wPxVSqre7LtFMMJyPbZlTBifh2MW mhB8icV3CMBPBcsqp16NulYGQTeey2F6OuGc+4UCxIS4Hizn0CFMX23MhIdkvzetm+Yq7Sb4A oj7RfjQqCnr5HO0trsu38U4LQeIBRiiJyfWS8phPtB/BBSPffVqVArwHGagnfNg2DvneEPTmI EYfsqmHbG2LypAh02ByPPE01teILhiUzHmoW9TVYwWCVbO8REvhG1L8fp4sv+WJqcjR+bCWBY 7izvz0HWsi1VmL6WUu1vGAlS6SKwpOj1ot+8LvTKddKL81ayKw08MjwE+2uD5FJQ6X2HAvozI tLt3IDdReh5E9XkPpsSmrxV9CC5m1paS3mSQeJZeLg6s49UA16PCiSaH4klq5BC6msaDA9VeN 5rIJ+PcRsHfIJeFtgFt5EWeBstP76VdXkLUWqgxVWMjAxt7AzAcce9d9+MFFW0caiNXswGbFP PyKo1cezISOEciKugKhv3Ta9evOLmOwyMdBStjVahoJrySQXdUJ7IxzWeY11zc94RR2fazAuJ R4BpN8fk2SUQjlkuilyqPc14bD+ZRkcarOFosCPUT1WXeRIbiBipVzv/dda8O+Q1ANO2kmbbD S17LE84 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, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 From: Markus Elfring Date: Fri, 1 Jan 2016 20:54:25 +0100 Return directly if a memory allocation failed at the beginning. Signed-off-by: Markus Elfring Acked-by: Stanislaw Gruszka --- drivers/net/wireless/intel/iwlegacy/common.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/intel/iwlegacy/common.c b/drivers/net/wireless/intel/iwlegacy/common.c index eb5cb60..c3afaf7 100644 --- a/drivers/net/wireless/intel/iwlegacy/common.c +++ b/drivers/net/wireless/intel/iwlegacy/common.c @@ -723,10 +723,9 @@ il_eeprom_init(struct il_priv *il) sz = il->cfg->eeprom_size; D_EEPROM("NVM size = %d\n", sz); il->eeprom = kzalloc(sz, GFP_KERNEL); - if (!il->eeprom) { - ret = -ENOMEM; - goto alloc_err; - } + if (!il->eeprom) + return -ENOMEM; + e = (__le16 *) il->eeprom; il->ops->apm_init(il); @@ -778,7 +777,6 @@ err: il_eeprom_free(il); /* Reset chip to save power until we load uCode during "up". */ il_apm_stop(il); -alloc_err: return ret; } EXPORT_SYMBOL(il_eeprom_init); From patchwork Mon Jan 11 13:42:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia-Ju Bai X-Patchwork-Id: 8003841 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 688E1BEEE5 for ; Mon, 11 Jan 2016 13:43:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8B32420279 for ; Mon, 11 Jan 2016 13:42:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C9EE620220 for ; Mon, 11 Jan 2016 13:42:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932367AbcAKNmx (ORCPT ); Mon, 11 Jan 2016 08:42:53 -0500 Received: from m12-12.163.com ([220.181.12.12]:48182 "EHLO m12-12.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758042AbcAKNmw (ORCPT ); Mon, 11 Jan 2016 08:42:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=8MhzmIA1uGrtLo8X2r hnX0pU+zv8C3nm2xao24te/SY=; b=e+5/bxKSLazRj/PXD9qTtIeH0QfT9fBAts 0gYvqULGybRBPL+xTDYkksa7Ocsiaag4hSvklK63ilArZwBngY8uGzAYQKN5AGhI n2pn9XTysxf3AY8m7yyeGb6f1WmB1Ld1WBvpYA33pq1vuNU0U2iHc9WjjJF//Rv6 5HRHQq+Tg= Received: from bai-oslab.tsinghua.edu.cn (unknown [166.111.70.58]) by smtp8 (Coremail) with SMTP id DMCowEBZ9E9HsZNWJzIRAA--.188S2; Mon, 11 Jan 2016 21:42:35 +0800 (CST) From: Jia-Ju Bai To: sgruszka@redhat.com, kvalo@codeaurora.org, johannes.berg@intel.com, emmanuel.grumbach@intel.com Cc: ilw@linux.intel.com, linuxwifi@intel.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Jia-Ju Bai Subject: [PATCH v2] iwl4965: Fix a null pointer dereference in il_tx_queue_free and il_cmd_queue_free Date: Mon, 11 Jan 2016 21:42:54 +0800 Message-Id: <1452519775-7049-1-git-send-email-baijiaju1990@163.com> X-Mailer: git-send-email 1.7.9.5 X-CM-TRANSID: DMCowEBZ9E9HsZNWJzIRAA--.188S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7CryUWFyUuF4fCF18Xw1DKFg_yoW8Cw4UpF W3Cr90kw4DXF42q39FyF4rZay5Xan5Jr4UWayruws8Aw1fCFySvF1jkF1I9rWkZFsF9a4F vrWq9F1rWF4DJ37anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UENtsUUUUU= X-Originating-IP: [166.111.70.58] X-CM-SenderInfo: xedlyx5dmximizq6il2tof0z/xtbBRQ7selO-zkw+KgAAsn 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 If "txq->cmd = kzalloc(...)" in il_tx_queue_init fails, "kfree(txq->cmd[i])" in il_tx_queue_free and il_cmd_queue_free in iwl4965_hw_txq_ctx_free will causes a null pointer dereference, because txq->cmd is NULL at that time. This patch fixes this problem by adding a if-check before kfree. To avoid double free in il_tx_queue_free and il_cmd_queue_free caused by the fixing, txq->meta and txq->cmd in error handling code of il_tx_queue_init are assigned null values. Otherwise, a double free will occur. This patch has been tested in real device, and it actually fixes the bug. Thanks Stanislaw for his suggestion. Signed-off-by: Jia-Ju Bai Acked-by: Stanislaw Gruszka --- drivers/net/wireless/iwlegacy/common.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c index 8871145..092ecbc 100644 --- a/drivers/net/wireless/iwlegacy/common.c +++ b/drivers/net/wireless/iwlegacy/common.c @@ -2794,8 +2794,10 @@ il_tx_queue_free(struct il_priv *il, int txq_id) il_tx_queue_unmap(il, txq_id); /* De-alloc array of command/tx buffers */ - for (i = 0; i < TFD_TX_CMD_SLOTS; i++) - kfree(txq->cmd[i]); + if (txq->cmd) { + for (i = 0; i < TFD_TX_CMD_SLOTS; i++) + kfree(txq->cmd[i]); + } /* De-alloc circular buffer of TFDs */ if (txq->q.n_bd) @@ -2873,8 +2875,10 @@ il_cmd_queue_free(struct il_priv *il) il_cmd_queue_unmap(il); /* De-alloc array of command/tx buffers */ - for (i = 0; i <= TFD_CMD_SLOTS; i++) - kfree(txq->cmd[i]); + if (txq->cmd) { + for (i = 0; i <= TFD_CMD_SLOTS; i++) + kfree(txq->cmd[i]); + } /* De-alloc circular buffer of TFDs */ if (txq->q.n_bd) @@ -3080,7 +3084,9 @@ err: kfree(txq->cmd[i]); out_free_arrays: kfree(txq->meta); + txq->meta = NULL; kfree(txq->cmd); + txq->cmd = NULL; return -ENOMEM; } From patchwork Sat Jan 16 13:08:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia-Ju Bai X-Patchwork-Id: 8049041 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 C6B779F6FA for ; Sat, 16 Jan 2016 13:08:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EBC4E2034C for ; Sat, 16 Jan 2016 13:08:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 26FA520328 for ; Sat, 16 Jan 2016 13:08:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751918AbcAPNIt (ORCPT ); Sat, 16 Jan 2016 08:08:49 -0500 Received: from m12-12.163.com ([220.181.12.12]:60709 "EHLO m12-12.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751633AbcAPNIs (ORCPT ); Sat, 16 Jan 2016 08:08:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=M7TLvzv//KTbpj41Pu RNUYEFZhdyPftdfw+6UyHFVlg=; b=bMxdJUZWLZqCEYL6owzrMmPalHjylPtrWh cjfDTddBVE6DMaSD3FYj5vL9a9L5Yy2zrGF8GZg1wDuJCR2D2aF/MJxkpEG9Yjjz 8DNXuNksmh+wPqV6N+tvyQ5Z6iruMK9bLkU26hkSBUhEN+dVOXFRVMYTdMxtaiWO arDJpr4j8= Received: from bai-oslab.tsinghua.edu.cn (unknown [166.111.70.23]) by smtp8 (Coremail) with SMTP id DMCowAAHKoSUQJpWV94oAQ--.64354S2; Sat, 16 Jan 2016 21:07:35 +0800 (CST) From: Jia-Ju Bai To: kvalo@codeaurora.org, zajec5@gmail.com, joe@perches.com, davem@davemloft.net, m@bues.ch, johannes.berg@intel.com Cc: linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org, netdev@vger.kernel.org, Jia-Ju Bai Subject: [PATCH v2 resend] b43: Fix memory leaks in b43_bus_dev_ssb_init and b43_bus_dev_bcma_init Date: Sat, 16 Jan 2016 21:08:10 +0800 Message-Id: <1452949690-16387-1-git-send-email-baijiaju1990@163.com> X-Mailer: git-send-email 1.7.9.5 X-CM-TRANSID: DMCowAAHKoSUQJpWV94oAQ--.64354S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7trykJryrXr4Uur4kCF13twb_yoW8GF15pF 4DGa42kw4xGr15C3yrAFs2yF15Wan2yrWq9FW2v39a9395Ar1Fk34UAFyfZryYyFW8Cay3 ZFWUt34UuFWDJFDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UEeHgUUUUU= X-Originating-IP: [166.111.70.23] X-CM-SenderInfo: xedlyx5dmximizq6il2tof0z/xtbBRRjxelO-zsAPFAAAsv 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 The memory allocated by kzalloc in b43_bus_dev_ssb_init and b43_bus_dev_bcma_init is not freed. This patch fixes the bug by adding kfree in b43_ssb_remove, b43_bcma_remove and error handling code of b43_bcma_probe. Thanks Michael for his suggestion. Signed-off-by: Jia-Ju Bai Tested-by: Sudip Mukherjee --- drivers/net/wireless/b43/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index ec013fb..bbea769 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c @@ -5682,11 +5682,12 @@ static int b43_bcma_probe(struct bcma_device *core) INIT_WORK(&wl->firmware_load, b43_request_firmware); schedule_work(&wl->firmware_load); -bcma_out: return err; bcma_err_wireless_exit: ieee80211_free_hw(wl->hw); +bcma_out: + kfree(dev); return err; } @@ -5714,8 +5715,8 @@ static void b43_bcma_remove(struct bcma_device *core) b43_rng_exit(wl); b43_leds_unregister(wl); - ieee80211_free_hw(wl->hw); + kfree(wldev->dev); } static struct bcma_driver b43_bcma_driver = { @@ -5798,6 +5799,7 @@ static void b43_ssb_remove(struct ssb_device *sdev) b43_leds_unregister(wl); b43_wireless_exit(dev, wl); + kfree(dev); } static struct ssb_driver b43_ssb_driver = { From patchwork Sat Jan 16 13:02:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia-Ju Bai X-Patchwork-Id: 8049011 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EA45FBEEE5 for ; Sat, 16 Jan 2016 13:03:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 311C42034C for ; Sat, 16 Jan 2016 13:03:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 338F520328 for ; Sat, 16 Jan 2016 13:03:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751651AbcAPNDm (ORCPT ); Sat, 16 Jan 2016 08:03:42 -0500 Received: from m12-11.163.com ([220.181.12.11]:42788 "EHLO m12-11.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751050AbcAPNDl (ORCPT ); Sat, 16 Jan 2016 08:03:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=nm8/bx19p2CVVMFtf+ pa6ugxeClOJhjKwyEjyRua7uw=; b=POc2407WSkgpKjYGUpvE8LJTlt5Ok9XOUk udR11oqCUQE9y8bjGqZE92zSGHcx9jAT0KH31Z3cVaKgzbyFkSQ0x6tURWhM0xli TUPAjluMns0T2dqRWvN5+/AGhhG9JyqIeuaK1utEcuPRBIYgd9DDpIpfrqCmeTBJ aL6GWeqTM= Received: from bai-oslab.tsinghua.edu.cn (unknown [166.111.70.23]) by smtp7 (Coremail) with SMTP id C8CowAA3PwddP5pWjjAtAQ--.40540S2; Sat, 16 Jan 2016 21:02:25 +0800 (CST) From: Jia-Ju Bai To: andrea.merello@gmail.com, Larry.Finger@lwfinger.net, flamingice@sourmilk.net, kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] rtl818x_pci: Disable pci device in error handling code Date: Sat, 16 Jan 2016 21:02:58 +0800 Message-Id: <1452949379-16052-1-git-send-email-baijiaju1990@163.com> X-Mailer: git-send-email 1.7.9.5 X-CM-TRANSID: C8CowAA3PwddP5pWjjAtAQ--.40540S2 X-Coremail-Antispam: 1Uf129KBjvdXoWruF1DZrWkZFyUAw47WrWDCFg_yoWkCrb_uF y0va97XFyrArnakr45Cry5AFZ09F1qqF48Wrs2qFyxurW5ZFZ8urWYvrn8Aa4UWF40kFy5 t34DXryrJayq9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUbOVyDUUUUU== X-Originating-IP: [166.111.70.23] X-CM-SenderInfo: xedlyx5dmximizq6il2tof0z/1tbipQLxelUL9YVxGAAAsr 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 When pci_request_regions in rtl8180_probe fails, pci_disable_device is not called to disable the device which is enabled by pci_enbale_device. This patch fixes the problem by adding a new lable in error handling code. Signed-off-by: Jia-Ju Bai Acked-by: Andrea Merello --- drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c b/drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c index a43a16f..c76af5d 100644 --- a/drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c +++ b/drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c @@ -1736,7 +1736,7 @@ static int rtl8180_probe(struct pci_dev *pdev, if (err) { printk(KERN_ERR "%s (rtl8180): Cannot obtain PCI resources\n", pci_name(pdev)); - return err; + goto err_disable_dev; } io_addr = pci_resource_start(pdev, 0); @@ -1938,6 +1938,8 @@ static int rtl8180_probe(struct pci_dev *pdev, err_free_reg: pci_release_regions(pdev); + + err_disable_dev: pci_disable_device(pdev); return err; }