Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1422064ybm; Thu, 23 May 2019 00:21:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZn+ZyJ1pKKyy1kBm46hunT2ns/aesgtblP7Lp45N/ba6PhyG+wjbrXnnVBxAKSjm/zjwu X-Received: by 2002:a63:f710:: with SMTP id x16mr81498771pgh.216.1558596077970; Thu, 23 May 2019 00:21:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558596077; cv=none; d=google.com; s=arc-20160816; b=P2KLuOcfGsqq5yO8FfTN4wHOdIgw8MrMXPQG75cOfII9lhKSNNFOp3eUeEfUUKmM0U jg/PE9ndqp1nPDVegvCLzegaAV+8mYPQVekXGKwn3mH8ezp9eL86hg6WWCmhQ8P810Zt qSNvRNbjKLXRaIp4Lx52N7qFP8Ojd/0zqkpiW9IkYDsT1zSSHTZc60radbmYHLR8JNMk 1+SLq+3961BwmQCcyqe+5GYgzZ1x0W31UiFO0vesuosry8mAg+mQKVCUrnJdXTDhu7us oKuBOQPioT1ZxUiCQxkpxyJSyHEOLlQX1TUUz8oTWTsV/LwhO/oyP0QeEQ/wtRNi3nGY kMGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=dLW0atUxHcHcUz8/sNmOmDTG2SYYTE+2PVIbeJRhEP4=; b=ISn6wI/OGf5bepEAgUDk39UZAEcoSIsE2n0MZ7cWSYTkHSLL+x2j0w/lI64mGv9ozu 8N/EBPkppylbF/0eDkQPyCT0/cYmF48oZWwtqtfEVnUuUrfxKIZ2RtozJrgdY88Vzi5n cSJkUt7Vcnm+dh45cZufEU2xjOAhnZYsEZaxkCFZ0Fv5Oxilv2TNZaY3Sww2KcqmEBXw BK8oypMZf2fknp/euaYRydI5V9gglMr3QvxcTMbMsg30rkj9ggHzPON9zshAzpEfzLq6 c3S3Y2tCYB9Zs1wg/BfWBx/Jr0CdNPpuw0FDiL/E+LSbVSxHM+Arv0b+S6VJ1HDMdOUI 6APw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Mf6sUuxr; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i8si11636266pgs.220.2019.05.23.00.21.02; Thu, 23 May 2019 00:21:17 -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=@kernel.org header.s=default header.b=Mf6sUuxr; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727428AbfEWHTw (ORCPT + 99 others); Thu, 23 May 2019 03:19:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:34050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbfEWHTw (ORCPT ); Thu, 23 May 2019 03:19:52 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C359220863; Thu, 23 May 2019 07:19:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558595990; bh=UiHyCFXjL7dy8g+ulDW/+CR0M95VuCg7XORYNuE3pCQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Mf6sUuxrbbuN7C8KpKmxn7e0BOLVyOMzy/QlB6sH4wB7AEAjlJ+1tnn9S237AbrM3 8Vo2V9HnmAyf1rwOfAvFhkP9D3rguCTUACSPiAj6fJWrUo70BwrtOYVRTm56NrThCT 0rWo6WIpNXoZaOyz6h7bWMCM1i88PUf6fwTSqYMM= Date: Thu, 23 May 2019 09:19:48 +0200 From: Greg Kroah-Hartman To: Hariprasad Kelam Cc: Nishka Dasgupta , Vatsala Narang , Emanuel Bennici , Henriette Hofmeier , Payal Kshirsagar , 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: Re: [PATCH v2] staging: rtl8723bs: core: rtw_mlme_ext: fix warning Unneeded variable: "ret" Message-ID: <20190523071948.GB24998@kroah.com> References: <20190522175501.GA8383@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190522175501.GA8383@hari-Inspiron-1545> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 22, 2019 at 11:25:01PM +0530, Hariprasad Kelam wrote: > 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; > - } Why did you delete the call to this function entirely? Is that ok? Why? thanks, greg k-h