From patchwork Fri Feb 12 14:04:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaehyun Lim X-Patchwork-Id: 8292051 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 EB14A9F6E4 for ; Fri, 12 Feb 2016 14:05:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 18737203EB for ; Fri, 12 Feb 2016 14:05:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 48407203F1 for ; Fri, 12 Feb 2016 14:05:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752916AbcBLOFO (ORCPT ); Fri, 12 Feb 2016 09:05:14 -0500 Received: from mail-pa0-f67.google.com ([209.85.220.67]:33301 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752891AbcBLOFK (ORCPT ); Fri, 12 Feb 2016 09:05:10 -0500 Received: by mail-pa0-f67.google.com with SMTP id y7so665470paa.0 for ; Fri, 12 Feb 2016 06:05:10 -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:in-reply-to:references; bh=G2FtI5JXqCbONoxa0JvovjlOTA6pCD7iR2uLIzL3WsA=; b=WX7187Cu6SushP3lHkC8YjQ7dx9aN0ffX5d1s4XRKAUqgsQcBeGsS+oJHQ3fJRW82U HqgNBQR11eWCtuRcONI+n3qWV1PiHHVkNFFwgJzsQCOe9W5k51VU/C3oLd8CqVDRrwJG hwv4b8PnQ/FDW4Y5hNaANlXlkaXEwqaQkzmsfBL+8eqAHI81+nqdqI9mDG2sXUqhCgJ7 F511/OSNkgpYz98f6A1JOSMaQdpAAHlVfMqhaoAUjkQTuUSanJqlUuwTojnEqveclsqk hGXeSIPb7uDiEyOo2E6UODXYRMGUfBp3Nu9nj/GfoFmrLORT2J+LtR6j78yM7PmMw9gq 8PQg== 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:in-reply-to :references; bh=G2FtI5JXqCbONoxa0JvovjlOTA6pCD7iR2uLIzL3WsA=; b=hTU23LYzt1EHA7B7kBX7Sft3k/czJ5ehks5FN/wJFX1C1BaqL49WNNZV1fc/5gZelv NDA+e+SKnC6ycR2NfgoWVnfWFlzi5mQ651ChwLwywZVVFpGuS5y9jBHNcjpeHr7jH+TW MMqOJTzQJG7MPkxFqCyI/i1Ve/mhQ3WV+CUfUxIljaGwyWYvoK0+gHOYRi54NwhKKt1D KDN64ofV4+bq7X5HKd5hFcFltQScyp+gq2WvdlP/uW6Uek/QpEqCpkbgXG0eOwBMtQOH Lg5ztRCW0snqUt2Mk8JGWIAaw0ylylJeWLaCTqhzN/HhgyR5ZQPWCSrQ/L7WRnMm1Q2E fKlQ== X-Gm-Message-State: AG10YOR4r+aX2MPe3KfcAimGgN07AhqLEAt0QGjwI/bNd/zY8wmVN5xMeKJ5vpvsMyKyig== X-Received: by 10.66.220.162 with SMTP id px2mr2327781pac.15.1455285910107; Fri, 12 Feb 2016 06:05:10 -0800 (PST) Received: from localhost.localdomain ([218.233.16.2]) by smtp.gmail.com with ESMTPSA id u64sm19814147pfa.86.2016.02.12.06.05.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Feb 2016 06:05:09 -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 07/11] staging: wilc1000: define a new local variable in wilc_scan Date: Fri, 12 Feb 2016 23:04:43 +0900 Message-Id: <1455285887-29946-7-git-send-email-chaehyun.lim@gmail.com> X-Mailer: git-send-email 2.7.1 In-Reply-To: <1455285887-29946-1-git-send-email-chaehyun.lim@gmail.com> References: <1455285887-29946-1-git-send-email-chaehyun.lim@gmail.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, 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 struct scan_info is defined as a new local variable in wilc_scan function. It makes some assignment short as well as improve more readability. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index a9c8b15..e9a6aa7 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3511,6 +3511,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type, { int result = 0; struct host_if_msg msg; + struct scan_attr *scan_info = &msg.body.scan_info; struct host_if_drv *hif_drv = vif->hif_drv; if (!hif_drv || !scan_result) { @@ -3523,26 +3524,26 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type, msg.id = HOST_IF_MSG_SCAN; if (hidden_network) { - msg.body.scan_info.hidden_network.net_info = hidden_network->net_info; - msg.body.scan_info.hidden_network.n_ssids = hidden_network->n_ssids; + scan_info->hidden_network.net_info = hidden_network->net_info; + scan_info->hidden_network.n_ssids = hidden_network->n_ssids; } msg.vif = vif; - msg.body.scan_info.src = scan_source; - msg.body.scan_info.type = scan_type; - msg.body.scan_info.result = scan_result; - msg.body.scan_info.arg = user_arg; - - msg.body.scan_info.ch_list_len = ch_list_len; - msg.body.scan_info.ch_freq_list = kmemdup(ch_freq_list, - ch_list_len, - GFP_KERNEL); - if (!msg.body.scan_info.ch_freq_list) + scan_info->src = scan_source; + scan_info->type = scan_type; + scan_info->result = scan_result; + scan_info->arg = user_arg; + + scan_info->ch_list_len = ch_list_len; + scan_info->ch_freq_list = kmemdup(ch_freq_list, + ch_list_len, + GFP_KERNEL); + if (!scan_info->ch_freq_list) return -ENOMEM; - msg.body.scan_info.ies_len = ies_len; - msg.body.scan_info.ies = kmemdup(ies, ies_len, GFP_KERNEL); - if (!msg.body.scan_info.ies) + scan_info->ies_len = ies_len; + scan_info->ies = kmemdup(ies, ies_len, GFP_KERNEL); + if (!scan_info->ies) return -ENOMEM; result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));