Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp3671455rwi; Wed, 2 Nov 2022 01:34:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5P2Z9X0m3AQTy/rYjlt3AWFjnDJlaZZG1G7ni2I4WXiBsHWL1KmxBnjFayiVVYoeCiPfvC X-Received: by 2002:a17:907:a80f:b0:7ae:3f7:b612 with SMTP id vo15-20020a170907a80f00b007ae03f7b612mr1896026ejc.421.1667378090623; Wed, 02 Nov 2022 01:34:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667378090; cv=none; d=google.com; s=arc-20160816; b=OvKUpEGc6PSLrEXKVpsgMTHA2sl/tAjsijY8giGEH0XaBL4+lpWhrMuRRVmOwV64Ve Zdcx/Gd2bNosgKs/T5QLWbWn7SGmmpYsDRUysgeIjSfpbQ1Rr/DhIw59NGuJDD9lFf25 exvAMAQ46i0QSTAVHfb4cUYkCRUj0xkS4cbd4Zx6IuyHYa8RLibKG5My9bPE22aArpjc jZXfGt2lxPNE8+A6iavkMOhsrYG0OOpG3+YGxyrm+j0aqTtWasneTYZPd7iQdpdSphpc Ms2L7M2NxsCjnun5pQ4MOJDyHv5GaT/JLTISvlhWwKJAshkc6XcIae0UChCifu4g1kUT i9+A== 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=Xqi86BVNEZy0PNzzpoW21WQntoBpZO35yZ2md7OS5/U=; b=amWCgju9pLCts8ry9IkP8/CKOqJYDMezziDMwy1y140SP1FaWYAdnCVTaQi7f54GVK nTjb0KmJg3HyMF/T9xH72iMeNMKQj5LoOcCnYs33JfYFgOJ/ItVkUhjEI9/sBchUGGm8 7bU8RPJ5+4/7HPBalxPz4V5o0G+2/ig2pTegxOSnqazhC0Z/aqc3ZXaI8e1GhFV5AtlS cMt629bqqVCXOb28/rzzR+CZ0XtXylWjoSMk0nuU/gyo0SALhRrCalGoW/iayz0SqRv1 Bk1zrGO4+Uf5NzIRJZQpZjYmkoUEtHhUCH8ldGKMx5Z1hqlBBlIgFYujbhnXC0RMis+2 LADg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=Y0xyzs5p; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hw19-20020a170907a0d300b0077083e6dde7si11107875ejc.183.2022.11.02.01.34.27; Wed, 02 Nov 2022 01:34:50 -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=fail header.i=@mailo.com header.s=mailo header.b=Y0xyzs5p; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230302AbiKBICy (ORCPT + 97 others); Wed, 2 Nov 2022 04:02:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbiKBICw (ORCPT ); Wed, 2 Nov 2022 04:02:52 -0400 Received: from msg-1.mailo.com (msg-1.mailo.com [213.182.54.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A208013F46 for ; Wed, 2 Nov 2022 01:02:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1667376155; bh=VKIIIg5Ow9y7BYrYGszDe/O+as8FGmI810ThX44IikU=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=Y0xyzs5pGSR1Iu1TqYpMZd2aE6Yk6L8Ehh0dO8hF/1rFvyz7Ok7ZUmmL35tzeFY3S PdOMxMsYc4jNSnk5dbak8agMnrWb60Ox2AKmm90Wsa5DT4uTGYAjs4z+lEU+vmD+V/ E+E3hSNAH9TJNaoNZTmIHpDrA5y/XqKK+gGsJQQ8= Received: by b-3.in.mailobj.net [192.168.90.13] with ESMTP via [213.182.55.206] Wed, 2 Nov 2022 09:02:35 +0100 (CET) X-EA-Auth: Xiede22fg5z65ZXwe/phWqFYfA6aaPeKR4bYp/aKyNsXF48FnuXBwt3VccAy9XBmO8VfenHNaxZxb8Y5YaXJxC0Gl2Kz7BAM Date: Wed, 2 Nov 2022 13:32:30 +0530 From: Deepak R Varma To: Greg Kroah-Hartman 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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 08:29:52AM +0100, Greg Kroah-Hartman wrote: > 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. Hello Greg, Looks like there was another patch effort in parallel to correct this coccicheck complaint. I am checking if all the observations from my patch are resolved. If not, I will rebase and send in revised patch. Thank you. ./drv > > thanks, > > greg k-h > >