From patchwork Thu Mar 3 12:05:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaehyun Lim X-Patchwork-Id: 8492231 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 6736FC0554 for ; Thu, 3 Mar 2016 12:06:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 91A622017D for ; Thu, 3 Mar 2016 12:06:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EC6FF2035E for ; Thu, 3 Mar 2016 12:06:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755223AbcCCMGR (ORCPT ); Thu, 3 Mar 2016 07:06:17 -0500 Received: from mail-pa0-f68.google.com ([209.85.220.68]:34922 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751247AbcCCMGQ (ORCPT ); Thu, 3 Mar 2016 07:06:16 -0500 Received: by mail-pa0-f68.google.com with SMTP id fl4so1151431pad.2 for ; Thu, 03 Mar 2016 04:06:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=0l2rYzJn31lWvj7+DNK9mw4edKS0U/TmJehZ6kApf5s=; b=wDGa3Wav+MrRKgZDGfGJuxkUdwQnpEV7AofJVfAO6kjvv+aQqnCVIeW7t5AEa9gW8b HQB3XaKelpTFe7+EMHRa73DGWJURlSuLzrmZ3XiikYg8Vi4bRBqtK9wXqg4xDtzan1co 5MUkXT2+kndxBVbIMlLTkbMtOblxddgke6VnlKXhpFk8nMxiZFWaEg8NE4hQoXVkbhG1 oeAcURSzIUBdza+Jz1Dl1z9ceS5oxmO1iuZgnwSAKAtGA3CQ8hdF/e+3j0xnygpnwq6s xL4qtGgfP4nQZcCGrc6pcf8kQW5TwrMNEwjn0jTXR1zrIpeufc27cL3Bblysjjvdf3Gq nCIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=0l2rYzJn31lWvj7+DNK9mw4edKS0U/TmJehZ6kApf5s=; b=NdnhfXV4bmrjbbLg5TDmxLJQCjZX+8bEYGt6/Zs93vs6W3/giOEd/u7x1WyM4xZ32y 5WlVuh1/Cfi58Fjoab0vmvzpDQ0gdVa1YEI+7vUu3YC72ziBY6yaYdGJ5hggsuUVoZ4m ZxOokW+G2isC3De8X1IVMVYYvwSVRvcIERZfSBloHDFGBXLcbYkV3VVN30/S9muIBOCl gz158ABXxiIW5KEGz5gtsS9PN5mauRPxZlsYyURoSJa41sokIowwZZ2rkNk4JiEtSJSy MWMAWtoiBDgLz+Rq2Pwqpxy1hwAccXvT6LEAIz4T7ScgqMsgTcKKe5nCFyL37FtuZEzx 85rA== X-Gm-Message-State: AD7BkJLlaOQUxBX9MKtw+qrp9a7jxvDibQPABHBriR5HD7ZbJ0KPSEmvttA+r/i8le4STA== X-Received: by 10.66.251.194 with SMTP id zm2mr3074047pac.131.1457006775689; Thu, 03 Mar 2016 04:06:15 -0800 (PST) Received: from localhost.localdomain ([218.233.16.2]) by smtp.gmail.com with ESMTPSA id v9sm15845386pfi.50.2016.03.03.04.06.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Mar 2016 04:06:14 -0800 (PST) From: Chaehyun Lim To: gregkh@linuxfoundation.org Cc: johnny.kim@atmel.com, austin.shin@atmel.com, chris.park@atmel.com, tony.cho@atmel.com, glen.lee@atmel.com, leo.kim@atmel.com, linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, Chaehyun Lim Subject: [PATCH 1/6] staging: wilc1000: use TAG_PARAM_OFFSET define Date: Thu, 3 Mar 2016 21:05:17 +0900 Message-Id: <1457006722-14400-1-git-send-email-chaehyun.lim@gmail.com> X-Mailer: git-send-email 2.7.1 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 TAG_PARAM_OFFSET is defined at top of this file so that it is used to simplify codes. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/coreconfigurator.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 25dc108..2c4ae1f 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -178,10 +178,8 @@ static inline void get_ssid(u8 *data, u8 *ssid, u8 *p_ssid_len) u8 i = 0; u8 j = 0; - len = data[MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + - CAP_INFO_LEN + 1]; - j = MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + - CAP_INFO_LEN + 2; + len = data[TAG_PARAM_OFFSET + 1]; + j = TAG_PARAM_OFFSET + 2; if (len >= MAX_SSID_LEN) len = 0; @@ -335,10 +333,8 @@ s32 wilc_parse_network_info(u8 *msg_buffer, tim_elm = get_tim_elm(msa, rx_len + FCS_LEN, index); if (tim_elm) network_info->dtim_period = tim_elm[3]; - ies = &msa[MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + - CAP_INFO_LEN]; - ies_len = rx_len - (MAC_HDR_LEN + TIME_STAMP_LEN + - BEACON_INTERVAL_LEN + CAP_INFO_LEN); + ies = &msa[TAG_PARAM_OFFSET]; + ies_len = rx_len - TAG_PARAM_OFFSET; if (ies_len > 0) { network_info->ies = kmemdup(ies, ies_len, GFP_KERNEL);