Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp126959yba; Mon, 20 May 2019 06:09:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0Y8ijhQbFFMq4SUnNFBKSG/L2wxVvaa0aFQtlZ0UiVguKHVWHVaQ+Ow+9LpwBXnzRCMoM X-Received: by 2002:a62:2fc6:: with SMTP id v189mr42862509pfv.136.1558357765990; Mon, 20 May 2019 06:09:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558357765; cv=none; d=google.com; s=arc-20160816; b=q3i1tmixmX1ZiswZXdBhpwihtLqJoTXvk70fSO68AYAqfOM3MPkbCSqzQhjtua0OUA wojMEHi3J9FI+mqsV+huhOp2u0XZquj5oGlRwr1ESo8qx+AiKANX0i2L6CavrTNlwDeS hPpi7IwfN5f0wHgerwGmVgy5uABBSXu3ukmfSpVW6cE/wCjYvh3oPXGTV5k/8/BN4qZ8 MmuEZ1ML14VJkbjYVku+3YZWK/PShS9gQeXBqvWuV/EvimlqcsnJ+3GKuuWZ6cZbft8g 3jeNlAQjwvgA4HiZGhr+XRwv/hcjE7y7RVPFsFGpuZ5+Z/k8G0fr19Gip+vQr+i+L0Pe IPPA== 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=KC8yBcKeOrN9u9GzCJ75OnfLNox0Jc04oN6egE0BAiE=; b=e7SgJo6cfLdXVoMgN4q0QBQAayxwBLjUZK//w9EDoU/NtbsUUAdw+eL11Gnv3Bb69Z T3diUmrc8RNOuRRGupHMpvmT7Z/NKq+g49rSTQvJ3yrqbVSFvxWQrHY29oEKVB0Spsx2 byZTE4OyL+U3YwczTNoHI4S2LyKFtrew0FYDlW4g6q0RgkvXofv5dxbaMnnI+oYTiSN9 4m2V6NM5WXQ9o8RJjaAo2Y315SwGmfBYxuyXusXIofrOuY/bJ713Dj8zdRxJN7XC1moP PPIhs148i8fNwa72mwj4S7DNhZ17//zXu6gXox32L61p6P3TLLr8mbJP34vlrsFQRYmv V61g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CLzPaHN+; 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 g22si17945922pgb.107.2019.05.20.06.09.07; Mon, 20 May 2019 06:09:25 -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=CLzPaHN+; 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 S1731636AbfETIyg (ORCPT + 99 others); Mon, 20 May 2019 04:54:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:56632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726436AbfETIye (ORCPT ); Mon, 20 May 2019 04:54:34 -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 94A5A204FD; Mon, 20 May 2019 08:54:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558342474; bh=FuGxZEbM7oawCwQGwg2EzuoBzEWp6BCjit9mc9pQiog=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CLzPaHN+K3lBQVjwdAbX1ZdNL7JPs4n3Jt8lfUV+HGnTAkxTYCXC+zfsBripKgWpx EBpoX3l5HN2J3LuZZ3/xcm9XeyR+mS5/G4Iq6MZDfVjDcgSiaTdPxHG/onefYfoJfC 2OplTTq3/IjIgqqXGTmmXM3YZMkjJCJnG1yU7UqM= Date: Mon, 20 May 2019 10:54:31 +0200 From: Greg Kroah-Hartman To: Hariprasad Kelam Cc: Emanuel Bennici , Jeff Kirsher , Madhumitha Prabakaran , Hans de Goede , Arnd Bergmann , Alexander Duyck , Paolo Abeni , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: rtl8723bs: os_dep: os_intfs: fix warning Unneeded variable: "status". Return "_SUCCESS" Message-ID: <20190520085431.GC19183@kroah.com> References: <20190519165758.GA6375@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190519165758.GA6375@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:27:58PM +0530, Hariprasad Kelam wrote: > This patch fixes below warnings reported by coccicheck > > drivers/staging/rtl8723bs/os_dep/os_intfs.c:228:6-12: Unneeded variable: > "status". Return "_SUCCESS" on line 333 > drivers/staging/rtl8723bs/os_dep/os_intfs.c:607:4-7: Unneeded variable: > "ret". Return "_SUCCESS" on line 669 > drivers/staging/rtl8723bs/os_dep/os_intfs.c:713:4-8: Unneeded variable: > "ret8". Return "_SUCCESS" on line 743 > drivers/staging/rtl8723bs/os_dep/os_intfs.c:1379:5-8: Unneeded variable: > "ret". Return "_SUCCESS" on line 1421 > drivers/staging/rtl8723bs/os_dep/os_intfs.c:1429:5-8: Unneeded variable: > "ret". Return "_SUCCESS" on line 1451 > drivers/staging/rtl8723bs/os_dep/os_intfs.c:1300:5-8: Unneeded variable: > "ret". Return "_SUCCESS" on line 1368 > > Signed-off-by: Hariprasad Kelam > --- > drivers/staging/rtl8723bs/os_dep/os_intfs.c | 18 ++++++------------ > 1 file changed, 6 insertions(+), 12 deletions(-) > > diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c > index 8a9d838..71dfac5 100644 > --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c > +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c > @@ -225,7 +225,6 @@ static int netdev_close (struct net_device *pnetdev); > > static uint loadparam(struct adapter *padapter, _nic_hdl pnetdev) > { > - uint status = _SUCCESS; > struct registry_priv *registry_par = &padapter->registrypriv; > > registry_par->chip_version = (u8)rtw_chip_version; > @@ -330,7 +329,7 @@ static uint loadparam(struct adapter *padapter, _nic_hdl pnetdev) > registry_par->qos_opt_enable = (u8)rtw_qos_opt_enable; > > registry_par->hiq_filter = (u8)rtw_hiq_filter; > - return status; > + return _SUCCESS; > } If this, or any of these other functions, can only return "success", then why return anything at all? These should be fixed up to either properly return an error if one can happen, or be a void function and fix up the caller function as well. thanks, greg k-h