Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp3625058rwi; Wed, 2 Nov 2022 00:51:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5t1sD8H55ZjzdoyZhFTE2sDJSlfgpUmpbd6jmOam/OrMiOYTpA3lrIiiojYG/WcM7AoisT X-Received: by 2002:a17:906:fe04:b0:777:b13d:30a6 with SMTP id wy4-20020a170906fe0400b00777b13d30a6mr22048752ejb.248.1667375517316; Wed, 02 Nov 2022 00:51:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667375517; cv=none; d=google.com; s=arc-20160816; b=VCfFOc4Uab3R0a1FMwPO0zSiz3KRA72qwTTSj7dvXEjdYHXd5R0IeihZox7fvFC/x1 PatklQ5xW7h92I/VJImuyfq5s9A2/cgKVGrIdS2MV4D8xFFf9k52siVG4zxSCmCxFITK 8+cYwpQ3ChsivtQV5oT5bfVxc+UupuoRTSEd8IEU+NStkGhLP2Zo73sy8L6dscolHW3k YYEcVWJa/nra8k5PnmVEbj9ZYQsxCa9yQPBE5iMoRX+bnokqQN+G9Huaxk/3Hre2B2CC T63mo+mFv9+uiOd6ORwMVZjV0n1IoHNbyU5NB1ZgxVvZrYzuQtMj8oTc4h0oW79I/oOe DUPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=I9O88VAl63y7EiZo3wVrKsyoFBTsVZslMeivT4Chsb8=; b=VaoSuLTjCblAHDeV6G4SlorQ7a7uRJZoa6zRJqh0H18Sf+W231qEHOyyLrCvZBYT2A 6sop67xf+qUp7Rk8dM4Yju3eyNlgFeZT/PW9Zt/YNf+e36kuGI505MM5R8PLrGZ+f1Lg OLLoX3Thu8Z7PEJv67twcqScn42xhLhvwDlhF0Jq/quNtPFlczTVutuPGKaHW/sl4xYV 5D/xj5Mjhxyl3GYzDFt/lT6znXrHqPZEy/bbeyijP/IkXo24MnXgK/TBFJmLJBrOrBiQ WRr7rACYrOVYJPHwKJ1TNxz7ZroWYiFqR3aL5ilHba83K2DTrcredeoMLVvkimmfDFF3 TKaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XqrH3xDI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z19-20020a05640235d300b00462535d609dsi17445471edc.97.2022.11.02.00.51.34; Wed, 02 Nov 2022 00:51:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XqrH3xDI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230141AbiKBH3E (ORCPT + 96 others); Wed, 2 Nov 2022 03:29:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbiKBH3C (ORCPT ); Wed, 2 Nov 2022 03:29:02 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6C2A10E6 for ; Wed, 2 Nov 2022 00:29:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8BC81B82115 for ; Wed, 2 Nov 2022 07:29:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 363D4C433D6; Wed, 2 Nov 2022 07:28:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1667374139; bh=PqmmqrMvPpwusmfzs25Ti0ixsJP9q/A+fj2LM+9egvc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XqrH3xDIeM0b5sTwegyRBlHHXq9ZtEE5eFDkazHzbdh+VJYTsUHUGWuiFOV07SRJO XSX0yoH0bFfVAhxo6P3KCMk15RvFuriHPS273ve2c4msaP/+qSV+auMJsJm8Eq8uiQ GNetBdjcjw27uJ0pUglzNLyR4GKhEdF6FIWc7jhA= Date: Wed, 2 Nov 2022 08:29:52 +0100 From: Greg Kroah-Hartman To: Deepak R Varma Cc: outreachy@lists.linux.dev, Larry Finger , Phillip Potter , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] staging: r8188eu: remove unwanted variable implementation Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 02, 2022 at 01:48:18AM +0530, Deepak R Varma wrote: > Local variables intended as the function return value are > initialized but their value does not change during function > execution. The initial value assigned to the variable is simply > returned to the caller. This makes the variable declaration > unnecessary and the initial value can be directly returned. > > Following table lists the initial commits when the variables were first > introduced but have not been used since inception: > > Variable Function File Inception Commit > ret rtw_sta_flush r8188eu/core/rtw_ap.c [1] > ret amsdu_to_msdu r8188eu/core/rtw_recv.c [2] > ret rtw_p2p_set r8188eu/os_dep/ioctl_linux.c [3] > > [1] 'commit 9a7fe54ddc3a ("staging: r8188eu: Add source files for new driver - part 1")' > [2] 'commit 1cc18a22b96b ("staging: r8188eu: Add files for new driver - part 5")' > [3] 'commit a2c60d42d97c ("staging: r8188eu: Add files for new driver - part 16")' > > However, local variable pull of the function update_txdesc from file > r8188eu/hal/rtl8188eu_xmit.c was in use prior to introduction of > commit ID [4] 7bdedfef085bb65. The clean-up associated with this > commit left the variable pull redundant. > > [4] 'commit 7bdedfef085b ("staging: r8188eu: Remove mp, a.k.a. manufacturing process, code")' > > The patch is produced using the following coccicheck options: > COCCI=./scripts/coccinelle/misc/returnvar.cocci > M=driver/staging/r8188eu/ > MODE=patch > > Signed-off-by: Deepak R Varma > --- > > Changes in v2: > 1. Include reason for why the variable declarations are not useful. Suggested > by Julia Lawall Does not apply to my tree at all :( Please rebase and resubmit. thanks, greg k-h