Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp754120ybm; Wed, 22 May 2019 10:56:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbmEeavxJ3F4w1f/5Ia4NO2WE/ntUgEPKW13httFd+s37XGrgxQihp2YNkByVGj2TVwuo3 X-Received: by 2002:a62:e718:: with SMTP id s24mr11225567pfh.247.1558547796209; Wed, 22 May 2019 10:56:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558547796; cv=none; d=google.com; s=arc-20160816; b=Hns7BaLNlhqBRbGcHWVeMHHr4akIYRaYsmYDe+UnD/JhHldLBzqjN+dwQC5LNP91mi ii3WtljUOqDgV4Munw5WkEJk0DxcwFPK//LWfGpN4dF4yJTW17l7vF+NCYz0qPNHrMyg eFiNTj4uzhmgbO45fA0DG2z6332AfV/rPpqki9xs3wP4lt7EJE+eNnzlcj+tmAh/kuQQ WJ4Cj8H6arsR7l/xDBypIf2PX9KGkn9PheQgmt0D27yu25j90dCvB5+vfHKTtmEMDJXp zbITlGPRUXdaGS9qT293rwUGtTRDYJOUTgnsu9lUWGqRN3VUfnAP/ssNjDk0PZEQKrv/ Nnxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature; bh=+3r9XlOPnzbK3z3FjSACcbiHwzswR8weMh25pGyOfPg=; b=D7sjuxJ1Xjpfihg+yoTjJMJmshb9Na4a8ngNmLIVwbjG9RSXnPAs50XHIWC4RHv3Li u8hnBfNIF0A7veovx9jRwS5g7mzTv2+nZ3Ni9LbCaoa5qRo4YcK8r3YmJ3RF/GSjzBDv o9S3nJqNYa+Q8S+U+x6N5j721jcR7XN5ATnYtkjKCh0ok6+MSQTAJZrjLZzEiv1u1Pzp VxrghA6qOjBN8W5kIf3wJzxoP7ysqCaKuCXEfuLR7evDkdBIn6LqvP+bTZ9F7ZVmxaM7 Uz2+eI0vmAN+uhJTAuH6TpMWRFHSO5sLfXlABMcpxPFOl0N88ik4OtXWShXMruL7a8I6 P7Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cKSYTSQ2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r204si28243980pfc.263.2019.05.22.10.56.18; Wed, 22 May 2019 10:56:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cKSYTSQ2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729003AbfEVRzL (ORCPT + 99 others); Wed, 22 May 2019 13:55:11 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:39453 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727975AbfEVRzL (ORCPT ); Wed, 22 May 2019 13:55:11 -0400 Received: by mail-pf1-f196.google.com with SMTP id z26so1717782pfg.6 for ; Wed, 22 May 2019 10:55:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=+3r9XlOPnzbK3z3FjSACcbiHwzswR8weMh25pGyOfPg=; b=cKSYTSQ2RqjpU+ut04v7P9lRKYr4f/oXVOho0VAUSXsfjokUmRHHmAJx7uVYcZlFNs Yoc5pbMzio+/c3pI79Y/uIdRelADA99uqMUacQ39zHo7SvOntPdDl/554luQ61etlkSR OFNHxAn6e5RvdpcROYT+qpdJGhM0VUSXgeBro8mU7Nt7bpWpKF7NcsaL/q58AmsvElJi L5505DXVd0A+DfV+gOYChvqxkLQoGAEIX5XEJqmynoWyFHpkU3e91Dlu9L5G6c6aGswS yw7rllIaHJ1zWNQCgJ4JUBF08JbQliZ39cCCUMG/bYzTox+qxiHriI24xFi2cea548kG OiVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=+3r9XlOPnzbK3z3FjSACcbiHwzswR8weMh25pGyOfPg=; b=qD5ZkV31bHLmCMVjw2d3pskgyP+hk/VT1Dlbp322Tqv1zsUJ8JM0Xjr4dMF1vKMXeI lAoXaP6Md2J1mYYUbYSe8A8vZESD3Cge5xBlaXhcli3izf5agBXwb+ZKQVWFju2a7pIq pYDT+kO8SIs9+CrRJF6aaM/pXNbKPB2A/AHqeDHEhAQQvYhtzve619eXjkDcvj+RrzLU Q2LBa0sWPgul8bLCcdpzaPvQ4PiJXrzBzEs1I3fVYGNYRm13cXM5GrkqPRMYKQlhK+m0 XvKeiwb98NiX4T+vYH5PSLGkeyReB7ovcTVjOfBaFrmCgUkYnEukdamffx5Y3oG7hixi Dgug== X-Gm-Message-State: APjAAAUY9Y+C/8IFe42wNNKLPysAMMusfamDwxLLu1BovfGphNQfD/bh jqE2mdlVjcGVovmwZZ69Y/Y= X-Received: by 2002:a63:8949:: with SMTP id v70mr91990157pgd.196.1558547710213; Wed, 22 May 2019 10:55:10 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.92.73]) by smtp.gmail.com with ESMTPSA id u134sm36730992pfc.61.2019.05.22.10.55.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 10:55:09 -0700 (PDT) Date: Wed, 22 May 2019 23:25:01 +0530 From: Hariprasad Kelam To: Greg Kroah-Hartman , Nishka Dasgupta , Vatsala Narang , Emanuel Bennici , Henriette Hofmeier , Payal Kshirsagar , Hariprasad Kelam , Hardik Singh Rathore , Madhumitha Prabakaran , Michael Straube , Hans de Goede , Jeff Kirsher , Arnd Bergmann , Paolo Abeni , Alexander Duyck , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] staging: rtl8723bs: core: rtw_mlme_ext: fix warning Unneeded variable: "ret" Message-ID: <20190522175501.GA8383@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch fixes below warnings reported by coccicheck drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:1888:14-17: Unneeded variable: "ret". Return "_FAIL" on line 1920 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:466:5-8: Unneeded variable: "res". Return "_SUCCESS" on line 494 Signed-off-by: Hariprasad Kelam ---- changes in v2: change return type of init_mlme_ext_priv() from int to void We cant change return type of on_action_spct() it is a call back function from action_handler. So directly return _FAIL from this function. ---- --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 9 ++------- drivers/staging/rtl8723bs/include/rtw_mlme_ext.h | 2 +- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 5 ----- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index d110d45..b240a40 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -461,9 +461,8 @@ static u8 init_channel_set(struct adapter *padapter, u8 ChannelPlan, RT_CHANNEL_ return chanset_size; } -int init_mlme_ext_priv(struct adapter *padapter) +void init_mlme_ext_priv(struct adapter *padapter) { - int res = _SUCCESS; struct registry_priv *pregistrypriv = &padapter->registrypriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); @@ -490,9 +489,6 @@ int init_mlme_ext_priv(struct adapter *padapter) #ifdef DBG_FIXED_CHAN pmlmeext->fixed_chan = 0xFF; #endif - - return res; - } void free_mlme_ext_priv(struct mlme_ext_priv *pmlmeext) @@ -1885,7 +1881,6 @@ unsigned int OnAtim(struct adapter *padapter, union recv_frame *precv_frame) unsigned int on_action_spct(struct adapter *padapter, union recv_frame *precv_frame) { - unsigned int ret = _FAIL; struct sta_info *psta = NULL; struct sta_priv *pstapriv = &padapter->stapriv; u8 *pframe = precv_frame->u.hdr.rx_data; @@ -1917,7 +1912,7 @@ unsigned int on_action_spct(struct adapter *padapter, union recv_frame *precv_fr } exit: - return ret; + return _FAIL; } unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_frame) diff --git a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h index f6eabad..0eb2da5 100644 --- a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h +++ b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h @@ -535,7 +535,7 @@ struct mlme_ext_priv }; void init_mlme_default_rate_set(struct adapter *padapter); -int init_mlme_ext_priv(struct adapter *padapter); +void init_mlme_ext_priv(struct adapter *padapter); int init_hw_mlme_ext(struct adapter *padapter); void free_mlme_ext_priv (struct mlme_ext_priv *pmlmeext); extern void init_mlme_ext_timer(struct adapter *padapter); diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c index 8a9d838..c2422e5 100644 --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c @@ -774,11 +774,6 @@ u8 rtw_init_drv_sw(struct adapter *padapter) goto exit; } - if (init_mlme_ext_priv(padapter) == _FAIL) { - RT_TRACE(_module_os_intfs_c_, _drv_err_, ("\n Can't init mlme_ext_priv\n")); - ret8 = _FAIL; - goto exit; - } if (_rtw_init_xmit_priv(&padapter->xmitpriv, padapter) == _FAIL) { DBG_871X("Can't _rtw_init_xmit_priv\n"); -- 2.7.4