Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp29894yba; Mon, 20 May 2019 04:26:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXoovp+emgcgstq5gCl7kZxUKCEDCDJXMZDBahMJlFgcgaj+hoYENSwqUMyaeAnvVgqHlb X-Received: by 2002:a17:902:5c6:: with SMTP id f64mr75513864plf.208.1558351570303; Mon, 20 May 2019 04:26:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558351570; cv=none; d=google.com; s=arc-20160816; b=mj1dxcCUgUTpsZs6yfWJl9nprf0pRFG+xnK5EchEKtTCSTBtjUGzyJNu9cwKxnddcd yjSdU4rTyGqBXUrhH9EEGhwgb4Lm/WA8x2rjORIN3NDPaLSafbSzPpmyomZohsU9kMFS 3jlbiZpGpBjljc9tJg+rHrQ000Mlr93GCB+b38oB0OJtAiNHabvfeyaYW0lkOfycIG1q /ZlKuEjCUL6LttQODGAUW7Dj39o05fUe95ucefF3r5eUgW8kyF7fEpy3G7iJ3A/QBSmD wy4AXNdhgwBhL1bi0DxSd1yp/DfyXZrtWRDvrFLNIufvFjFu7ncy84C5XEA7W9BM86dj P1yA== 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=3Yg1NnbXy4jNRoUbKfMizPSBKHUohkw/NUQJqawoCsA=; b=LAdGRkMVCiZnbd/tjQmfasMBp5Rq+1DWZqePHvdzlAnsAj4hdAFfQ1oTgTWwdbbOjY zJGqOOqQCsiwgctI9U4V9IBxHIpYaZyHlbs0G2AUMN4ehrvj9Hxw918uuR8qK1tMHxWT 11US3bPfNxqr2hZ/QVUDObCKCSD6OUCd6fIb8NbOvqaOf55TdXEZcIZtufXWcr/9yl0q qrXWJzh2YTcUKtX3sX576Ruv9Jif3XIPzDqv+JWNNoVQ2RwxWq/z5X/T+T/5sIltHivW SQ2/68NvSsunYYl/NRR3jNxWxuzOQilyWYL0fQv+Z5353JAGtRIoVkhDVPPu/9C1hjoC 16Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gCkQ3Z4l; 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 l62si16974988pga.434.2019.05.20.04.25.55; Mon, 20 May 2019 04:26:10 -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=gCkQ3Z4l; 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 S1731620AbfETIxU (ORCPT + 99 others); Mon, 20 May 2019 04:53:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:56142 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726436AbfETIxU (ORCPT ); Mon, 20 May 2019 04:53:20 -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 87FD8204FD; Mon, 20 May 2019 08:53:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558342400; bh=Gzdv2G9YQ9dpAcYx/XvqRPmHwUG7jB3vlOP7A7rqhvw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gCkQ3Z4lwefkORcLgEFSbGwbj/n7JSpCcbVxZpadh9vkcMEKG1enRAbFz0rtz5jC1 j16rTI4r9UWWr4H5yAdt6riJYg3bhm5Djc9jh/al+n6NdLGodXtiKoCakXNbCXNIvu KYisKGryocGLDKMWLGvhP5lSKPs6e0lO4u2vEor4= Date: Mon, 20 May 2019 10:53:17 +0200 From: Greg Kroah-Hartman To: Hariprasad Kelam Cc: Mamta Shukla , Nishka Dasgupta , Hardik Singh Rathore , Anirudh Rayabharam , Murray McAllister , Kimberly Brown , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: rtl8723bs: core: rtw_ap: fix Unneeded variable: "ret". Return "0" Message-ID: <20190520085317.GB19183@kroah.com> References: <20190519164445.GA5268@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190519164445.GA5268@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 Sun, May 19, 2019 at 10:14:45PM +0530, Hariprasad Kelam wrote: > This patch fixes below warnings reported by coccicheck > > drivers/staging/rtl8723bs/core/rtw_ap.c:1400:5-8: Unneeded variable: > "ret". Return "0" on line 1441 > drivers/staging/rtl8723bs/core/rtw_ap.c:2195:5-8: Unneeded variable: > "ret". Return "0" on line 2205 > > Signed-off-by: Hariprasad Kelam > --- > drivers/staging/rtl8723bs/core/rtw_ap.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c > index bc02306..a1b5ba4 100644 > --- a/drivers/staging/rtl8723bs/core/rtw_ap.c > +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c > @@ -1397,7 +1397,6 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr) > int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr) > { > struct list_head *plist, *phead; > - int ret = 0; > struct rtw_wlan_acl_node *paclnode; > struct sta_priv *pstapriv = &padapter->stapriv; > struct wlan_acl_pool *pacl_list = &pstapriv->acl_list; > @@ -1438,7 +1437,7 @@ int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr) > > DBG_871X("%s, acl_num =%d\n", __func__, pacl_list->num); > > - return ret; > + return 0; > } If this function can never fail, why does it have a return value at all? Please fix that up instead. > > u8 rtw_ap_set_pairwise_key(struct adapter *padapter, struct sta_info *psta) > @@ -2192,7 +2191,6 @@ u8 ap_free_sta( > int rtw_sta_flush(struct adapter *padapter) > { > struct list_head *phead, *plist; > - int ret = 0; > struct sta_info *psta = NULL; > struct sta_priv *pstapriv = &padapter->stapriv; > struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; > @@ -2202,7 +2200,7 @@ int rtw_sta_flush(struct adapter *padapter) > DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(padapter->pnetdev)); > > if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE) > - return ret; > + return 0; > > spin_lock_bh(&pstapriv->asoc_list_lock); > phead = &pstapriv->asoc_list; > @@ -2227,7 +2225,7 @@ int rtw_sta_flush(struct adapter *padapter) > > associated_clients_update(padapter, true); > > - return ret; > + return 0; > } Same here. thanks, greg k-h