From patchwork Wed Mar 19 15:02:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gang ZHAO X-Patchwork-Id: 3859651 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A717E9F334 for ; Wed, 19 Mar 2014 18:17:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CE99820122 for ; Wed, 19 Mar 2014 18:17:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ECAF820173 for ; Wed, 19 Mar 2014 18:17:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965281AbaCSPDm (ORCPT ); Wed, 19 Mar 2014 11:03:42 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:35242 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965274AbaCSPDl (ORCPT ); Wed, 19 Mar 2014 11:03:41 -0400 Received: by mail-pa0-f47.google.com with SMTP id lj1so9016439pab.6 for ; Wed, 19 Mar 2014 08:03:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Kytj+0/vTAlTumWaF3M8GNYjOESky5gTmKJ/xTPAIMY=; b=yl1EteOCXq7yKIMqvK1mhao3Dys8g7YEr/dl8r3DSgqRH1uXLFJ83EfmE8NcKQsstm 9CNhQDDfd7zsLhoT2pw5HmTZ8qwZVfq6Y3dhuhCc58NZ0G15OMObzOeR3gfr4sJ4Gilc l9hx33RYGitfUSow+d8O/fWEr8ILEyhQo1p2jswZr5XwBU2pA/sO66diDHPigDJlFznk uNeSIjMUkt8QVR8UAV66GAy2ihfscwuFM65yMR49FYlpB/QUqR+rwBnbwVcHes56XyCk aQ3YCnnrPWF7vTANGtESJFv5UhRG5ZCShl7ibXmQ6u8SqxzVnUZFSD/Knc/AXnlPUXhT uwJQ== X-Received: by 10.66.231.73 with SMTP id te9mr20412346pac.17.1395241421280; Wed, 19 Mar 2014 08:03:41 -0700 (PDT) Received: from localhost.localdomain ([61.157.126.30]) by mx.google.com with ESMTPSA id vb7sm63099814pbc.13.2014.03.19.08.03.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Mar 2014 08:03:40 -0700 (PDT) From: "Zhao, Gang" To: Cc: Johannes Berg Subject: [PATCH 3/3 v2] cfg80211: slightly clean up of cfg80211_sme_connect() Date: Wed, 19 Mar 2014 23:02:21 +0800 Message-Id: X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1395239207.4142.25.camel@jlt4.sipsolutions.net> References: <1395239207.4142.25.camel@jlt4.sipsolutions.net> 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, T_DKIM_INVALID, T_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 Wdev->ssid_len has already been set in cfg80211_connect() and is equal to connect->ssid_len. Use wdev->ssid_len instead of connect->ssid_len so it will be consistent with previous ssid assignment statement. If bss is found in cfg80211_get_conn_bss(), wdev->conn->state is set to CFG80211_CONN_AUTHENTICATE_NEXT in there. So it's not needed to set it manually to CFG80211_CONN_AUTHENTICATE_NEXT if bss is found in that function. Signed-off-by: Zhao, Gang --- v2: change the assignment of ssid_len, instead of ssid before. net/wireless/sme.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/wireless/sme.c b/net/wireless/sme.c index acdcb4a8..998674f 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c @@ -468,7 +468,7 @@ static int cfg80211_sme_connect(struct wireless_dev *wdev, } wdev->conn->params.ssid = wdev->ssid; - wdev->conn->params.ssid_len = connect->ssid_len; + wdev->conn->params.ssid_len = wdev->ssid_len; /* see if we have the bss already */ bss = cfg80211_get_conn_bss(wdev); @@ -480,7 +480,6 @@ static int cfg80211_sme_connect(struct wireless_dev *wdev, /* we're good if we have a matching bss struct */ if (bss) { - wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT; err = cfg80211_conn_do_work(wdev); cfg80211_put_bss(wdev->wiphy, bss); } else {