Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1248643ybi; Thu, 30 May 2019 14:11:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqzH4/iLJWkB/FcTs2CsIjqyl/5ZRjbrHcHEyT7G/tZv7Vt9nZFCm+9LJ4B06bYtDbUFnnof X-Received: by 2002:a17:902:8e8a:: with SMTP id bg10mr5381406plb.247.1559250705844; Thu, 30 May 2019 14:11:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559250705; cv=none; d=google.com; s=arc-20160816; b=QdW1GQq5EQOH8tK2gthzKuk2JdDcdq/YSsotBz2BO+VFsw5i0I6FGfcfIUFY5wZPcR uEDOstd02LdIz1F1LGRXDrYHLKJUvJmgr6Z3tfbHUhQzgANDTGvb+JFjHYrTmPosqZaI 9j14gvF50RgQrtnJxlTZxTTKOm6+p3WZTh8/DqYuv6o5wFt/Qt+ieU0x5+jKvUiaT9AE e920DYBSXuxKZlBrwr+L7Kz1imB7BNlbmtUxqwrihvzx3BD4s9Ja+7y9Lpx/TyCnCSTc s/bw+BLWTfkbUte+t1Ruw86jJ0uoh9sF6qm2jXJTDMZtgnffa0Lv3bZ2EWJz96j0gRIs TyjA== 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=kH/584SK7sqL0kGhwiz5aifrcei7fGB8GyVbm5J5r0A=; b=m4peOHeDgqqKLxfy1ck/cTGZNw6jEEuM36qxpMjNbjHTNFhgsfO4jCx1Yv6wizsSg2 mmZcE/eR1oow98BY7P7MDMi05HwiX9niFQhSC4jo3cjHmwUsoQdZS0CkO10leJX5z3jJ 93m2pBDd4DQ+iwLfTcMz1BNERm8XDkIT2u5Yb0YS1+o4jqd8e69jOhVC6R9MnJ6gzVY0 e5Jax6ThWfakJR3EwfFEWBQadS32KmKEwH9qDRSkaPwzPW4xQC+atx+B6JTyN5MEzpPC G7AKVhTxj9upX8x2HJTLqYxS2egaww3SnmRXIZzyfFMcPiL+5tfA3r2RP4BWpbqZWQJ4 4n5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CGckxHtH; 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 j22si4325349pfe.43.2019.05.30.14.11.29; Thu, 30 May 2019 14:11:45 -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=CGckxHtH; 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 S1726558AbfE3VJo (ORCPT + 99 others); Thu, 30 May 2019 17:09:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:44586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726079AbfE3VJo (ORCPT ); Thu, 30 May 2019 17:09:44 -0400 Received: from localhost (unknown [207.225.69.115]) (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 8F6C2261A1; Thu, 30 May 2019 21:09:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559250582; bh=6/Bn59/+vl2K5/idmqH2J+1q6RKOCaWO4Jg+AB0eFyM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CGckxHtHODHnGLOmF9kzYy6wgcp21NbBeNzGKHJd8Tw+kqp0CZnd0Gl28zy0Yzcd8 ZaUCTQVJgKQT/XNFq8qsYnf2FNoSVpcyIcjEymAx+EQ/y/BCcFSn/ml0JqhFKFzC4T urbPBCx47fWWXNGb+DpAwfdcjexOkPQnfyTyAGE4= Date: Thu, 30 May 2019 14:09:42 -0700 From: Greg Kroah-Hartman To: Hariprasad Kelam Cc: Vatsala Narang , Emanuel Bennici , Nishka Dasgupta , Hardik Singh Rathore , Madhumitha Prabakaran , Michael Straube , Hans de Goede , Arnd Bergmann , Paolo Abeni , Alexander Duyck , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [Patch v3] staging: rtl8723bs: core: rtw_mlme_ext: fix warning Unneeded variable: "ret" Message-ID: <20190530210942.GA11363@kroah.com> References: <20190523173940.GA6591@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190523173940.GA6591@hari-Inspiron-1545> User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 23, 2019 at 11:09:41PM +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. > changes in v3: > Dont remove initilization of init_mlme_ext_priv > --- > 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 | 6 +----- > 3 files changed, 4 insertions(+), 13 deletions(-) > > diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c > index 65e8cba..4b0129c 100644 > --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c > +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c > @@ -458,9 +458,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; > @@ -487,9 +486,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) > @@ -1881,7 +1877,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; > @@ -1913,7 +1908,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..4afb35b 100644 > --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c > +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c > @@ -774,11 +774,7 @@ 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; > - } > + init_mlme_ext_priv(padapter); Always run checkpatch.pl on your patches so you do not get grumpy maintainers telling you to run checkpatch.pl on your patches :(