From patchwork Fri Jan 15 13:12:01 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: 8040201 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 A16199F859 for ; Fri, 15 Jan 2016 13:12:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D39EE2041A for ; Fri, 15 Jan 2016 13:12:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A78C201B9 for ; Fri, 15 Jan 2016 13:12:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755861AbcAONMY (ORCPT ); Fri, 15 Jan 2016 08:12:24 -0500 Received: from mout.web.de ([212.227.15.4]:59774 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753259AbcAONMW (ORCPT ); Fri, 15 Jan 2016 08:12:22 -0500 Received: from [192.168.1.2] ([78.53.181.97]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0M8zhl-1aS1Jm0pgr-00CNau; Fri, 15 Jan 2016 14:12:03 +0100 Subject: [PATCH v3 3/3] rsi: Replace variable initialisations by assignments in rsi_send_data_pkt() To: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Fariya Fatima , Jahnavi Meher , Kalle Valo References: <566ABCD9.1060404@users.sourceforge.net> <5687E169.4070704@users.sourceforge.net> <5698EE65.7010607@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall , "John W. Linville" From: SF Markus Elfring Message-ID: <5698F021.1070707@users.sourceforge.net> Date: Fri, 15 Jan 2016 14:12:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <5698EE65.7010607@users.sourceforge.net> X-Provags-ID: V03:K0:2vy0TvUfyAoEe8z2Jn4G/DfEKV1jTIrjO3nbUKgavolnp7jXyVV ieMxVK3MFEzILRFONb6+WUJjzOsg/Hu5TwhKP05lLP58eP56WLm13Mg258msov2uPjMLNf0 eHuBlOvfPoFaOPgI1HXgoSfTaVNRBuWQm9GMDutmzwJJnIU3P5r3qyrg08ueiP5gVIIqk0B 7ctozsQq7y9I8La2aAmtA== X-UI-Out-Filterresults: notjunk:1; V01:K0:+YuCLT11Lo0=:LY59Dn9lS3auhmx2VWL2r9 av+PWYvI3mXKBSt2yHov/T7tNP1c+73FrUK/tgkW36rAiGd0hAWSitE9tHHBP3rUTERLwufSB kG+pjvaPfBEKXHauVzxDkehmbOnlXMUmFYWUmvStuNpoIvYQZtT+qwKblZjmgsAfUeKIkmnCf AgbZLPoCwD2jSXlmQDK9aMvB8vLCjaQQTIPFBqHhOuhyPVpdw67VkYmCTLiYYFmj2RXUR7Ia9 6fP7avvLnPNa44yoFcQV7xigqqtalF4+lOW+eGcmB56nz+ch82fCD5n6qfdQqtlnl0JSUWoWW +d0hW173KptI2i/37+XH7tga9RGHUNAql6ji4g2hNNk5XlLQq9DcCbeUraePsqdAP1Tm+BZoU MCkAi3UlgAa+uB68nq0VG4zEl7t8jpO5f03esyDMNVH8MYr0NOf28BIrZqADgMphxMXsCrPZC 3paF+ra0b+x4UiiAc+qdrkOTGFukBPK0h7dswB/ymguVeCqemVzrgW7f23IK4nrvj484Ck3Ay D84K5HaQ8naO6WPe0hL9ndANu3Xyb7OjQDKQjEUbfTY3b6vPHOH5OjeP7VlzaohVNkVldwUTk Owt0sjXRb5a35jXILhSS+oU3A94f3LoMYDGVTRVSgZvve+bt3V5MrcPIiWI227uxEN/6NnFpT kz6CkXkYyMAL6Wmwbo+/3CSaaGOt9IH1wwu/BnFucTcpJsIUsbrtzFV0dwEnHGjYZkkac2G59 Hbcp+9o3BvCrZ6hIVFrlqcP1491yhQk1M4S+LYes15Xby2ZtzrwTmfbmXXjj5nPbX61JgZjp2 ILZ/HmJ 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, 15 Jan 2016 13:40:22 +0100 Replace explicit initialisation for two local variables at the beginning by assignments. Signed-off-by: Markus Elfring --- drivers/net/wireless/rsi/rsi_91x_pkt.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_pkt.c b/drivers/net/wireless/rsi/rsi_91x_pkt.c index 4322df1..2c18c01 100644 --- a/drivers/net/wireless/rsi/rsi_91x_pkt.c +++ b/drivers/net/wireless/rsi/rsi_91x_pkt.c @@ -26,12 +26,12 @@ */ int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb) { - struct rsi_hw *adapter = common->priv; + struct rsi_hw *adapter; struct ieee80211_hdr *tmp_hdr; struct ieee80211_tx_info *info; struct skb_info *tx_params; struct ieee80211_bss_conf *bss; - int status = -EINVAL; + int status; u8 ieee80211_size = MIN_802_11_HDR_LEN; u8 extnd_size; __le16 *frame_desc; @@ -41,8 +41,10 @@ int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb) bss = &info->control.vif->bss_conf; tx_params = (struct skb_info *)info->driver_data; - if (!bss->assoc) + if (!bss->assoc) { + status = -EINVAL; goto err; + } tmp_hdr = (struct ieee80211_hdr *)&skb->data[0]; seq_num = (le16_to_cpu(tmp_hdr->seq_ctrl) >> 4); @@ -97,7 +99,7 @@ int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb) frame_desc[7] = cpu_to_le16(((tx_params->tid & 0xf) << 4) | (skb->priority & 0xf) | (tx_params->sta_id << 8)); - + adapter = common->priv; status = adapter->host_intf_write_pkt(common->priv, skb->data, skb->len);