Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4755592yba; Mon, 20 May 2019 03:15:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzFeMbnN/RYECw0GRfyJVeJSXQQcBrkqOUV2Ir19xxGzG+ox0d6sFJuAH+2+6LPutfcR+H/ X-Received: by 2002:a17:902:6b8b:: with SMTP id p11mr73751815plk.225.1558347333122; Mon, 20 May 2019 03:15:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558347333; cv=none; d=google.com; s=arc-20160816; b=XnOyfkUk2aN8smkBpFcuDp6vnTmzwihtsB6jlW6QpFiXzZoRREx1Kaw7cVpNE7Dv6M 0sl+Xn8BotQA4nafPqGEdw3Kq0J6hbHiQeaTYwYZaHdZIO82K4wFL/99Xc7RJFHh5dO2 aKGHt0KDp0y8PSDVdoq54dDDQVtNtaTUzVtR59UecvVrtg9exR6oZdg6AmmboXD7/FYr JejWxju3k0Mlg4lBK3O2IPj3XP8WJhtUZobYvGJhmC58Rl2w73I+xlk1R7kj815eOSy1 EsIhjM+CuG3uqicvEW/jxNk5zGQSRpQ1cc/aXwbjhaJn9Vokbqp6if8FxvRPx4nGIAaH oQJQ== 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=5F7l2rTDUWeSaH4P8S8EY5IwgWTZZIh6piXNYLlHGbo=; b=hLARHLkeLvKNzguwcTUq853YOnWFqB8HyBDLhlN76C2o4QBGqVDLKpJiBL9Iy0Bfm2 32E7hZRDn8/SAk6P5Ew6+QJFYav3T68iYHa/D5rEgZiiE4yyNloUt0pejhL7AxKhvIVD wS9q+EXVzCeJa8yBIMcoOaf1EL8B2o5bqmnI8wh34l+16O21BPe/pzDxvPSlpMDZ588n ZkrLFOYSFdnvfNeAReIPsomI6zcrZD2eIBZGQ1cQC0X5z3ZZZiwCfrx6EqKzQh3tWix/ pSO8Sm9AHje6oC8KM+HKMD38dnPWpJ+i3g6/SNHFCFwapzdgIBuWA6F/yZ8QJ5rTZO5s Z+VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kBghcluu; 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 g1si10846993pgk.240.2019.05.20.03.15.18; Mon, 20 May 2019 03:15:33 -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=kBghcluu; 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 S1731702AbfETI5M (ORCPT + 99 others); Mon, 20 May 2019 04:57:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:58256 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725372AbfETI5M (ORCPT ); Mon, 20 May 2019 04:57:12 -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 E9A56204FD; Mon, 20 May 2019 08:57:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558342631; bh=sqBRBNYx88jBR4CAFDwy0bVCEpQ/bWh2PM+rtQzV+Uo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kBghcluu904iLZDgDasB1qWGsD1n65j6ly4K7EwC5tyFIyy9xsPyVKKMgaRPTbANg u0OP6z70K/Dh/64Rdj4KSaIr3Rno1yrKWcaa3CjB8tG0sXsz74M0usmQVngvW68VRb ghI/2JiwB78f+zmRVRji3Fnpx619EVvlYF81WW0A= Date: Mon, 20 May 2019 10:57:09 +0200 From: Greg Kroah-Hartman To: Hariprasad Kelam Cc: Payal Kshirsagar , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [Patch v2] staging: rtl8723bs: hal: odm_HWConfig: odm_HWConfig: Unneeded variable: "result". Return "HAL_STATUS_SUCCESS" Message-ID: <20190520085709.GE19183@kroah.com> References: <20190519172723.GA9329@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190519172723.GA9329@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:57:24PM +0530, Hariprasad Kelam wrote: > This patch fixes below warnings reported by coccicheck > > drivers/staging/rtl8723bs/hal/odm_HWConfig.c:501:4-10: Unneeded > variable: "result". Return "HAL_STATUS_SUCCESS" on line 526 > > Signed-off-by: Hariprasad Kelam > ----- > Changes in v2: > - fixed typo in commit message > --- > > --- > drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c > index d802a1f..4711c65 100644 > --- a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c > +++ b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c > @@ -498,8 +498,6 @@ HAL_STATUS ODM_ConfigBBWithHeaderFile( > > HAL_STATUS ODM_ConfigMACWithHeaderFile(PDM_ODM_T pDM_Odm) > { > - u8 result = HAL_STATUS_SUCCESS; > - > ODM_RT_TRACE( > pDM_Odm, > ODM_COMP_INIT, > @@ -523,5 +521,5 @@ HAL_STATUS ODM_ConfigMACWithHeaderFile(PDM_ODM_T pDM_Odm) > > READ_AND_CONFIG(8723B, _MAC_REG); > > - return result; > + return HAL_STATUS_SUCCESS; > } This whole function should really be reduced to just one line (the trace stuff is not needed), and as this can not fail, it should not be returning a value. And if it can be one line, then why is it a function at all? It's only called in one place. thanks, greg k-h