Message ID | b7053d8737c048d6a878609f0ec24d66b18c5abd.1666754500.git.drv@mailo.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp181434wru; Wed, 26 Oct 2022 03:43:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM68vNROlLFKBIbXtSNwvTj2u1kQL1MbG/Zm4iRuvskuzI2xchHyubYRJohkZ5PRBelaw3mc X-Received: by 2002:a63:5950:0:b0:459:35df:3014 with SMTP id j16-20020a635950000000b0045935df3014mr36544842pgm.325.1666780990247; Wed, 26 Oct 2022 03:43:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666780990; cv=none; d=google.com; s=arc-20160816; b=foH4z+/HCEifNTtg/Eq8hitxJJ4r+6PH6t4pfwv47Hlz7RTScktPcTMqRVAus+vc9q EdSgzegmOZOeivGTz9Fzqj+wA0Bl5S/7iDH0eCf6Ul3yXjFVNFgGCLLhj5ip6jC01hVF euekCkyzBnhoYSAASew3/G5U8IFfiUSWHTeJjNeYlvvX+fZJjB9f4jpkw2ULdbhAm5Dn w8AdDAkgrli4Z/JVPdgEc28G8lP46K+zWSm9o0FUKbd3YyqFsQk9TvhWBvOuOTeR3BXj HWvdxPBIiL+qTLt5XGkRtojOUIgicLhfZPbp65Jzzg33pVekHzb4+BI9XIeyJJ+4/KYL u+NA== 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:to:from:date:dkim-signature; bh=ecBY38ARrvZ8Rk4pVLNDMk2mHsnyvAaOR8Gw3uIs2+E=; b=OTOjNjCTU/FCGGM25ZIGXYPN5SyDDZwFXcwuOdkTugLdetpSXzwWB/WWaxjJKvdz3A CjYhfroYAUJN8c2qy4svUR3YiqRDcj+Nycuoe9vPuQgrsyByn6kOkdYTkiybliP+jZHR MmK7i9Dqwy+x9KgPOUhjDQYmWffJQpemTpiFO4/94UEeSboW1yBvyFkMoR0gpv+EfPHx 2T9ra9waDWu0Jio5otbLwovB2UIOuRsX8D4Me4DNg5C3JAHgeYaaA6wT6giwdusqdtQ+ HurIozDImsIdeY6nLBp8tBzU+zO3BCllkVZ8OfL5vqAKhLneGV/1pC5MJki9sBCrvFs1 ey0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=n9MF0KHe; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c2-20020a63ea02000000b00438806c7b2bsi5601561pgi.154.2022.10.26.03.42.54; Wed, 26 Oct 2022 03:43:10 -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=n9MF0KHe; 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 S233356AbiJZKjq (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Wed, 26 Oct 2022 06:39:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbiJZKjp (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 26 Oct 2022 06:39:45 -0400 Received: from msg-1.mailo.com (msg-1.mailo.com [213.182.54.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E06C34D4C9 for <linux-kernel@vger.kernel.org>; Wed, 26 Oct 2022 03:39:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1666780641; bh=2o2vObTUWUB0Kdk6K5kLMVJ/u7FvQKx9DpX0JHVrhzY=; h=X-EA-Auth:Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=n9MF0KHexYUfDnyDE20lf405Xu6eQgg5AD5PItaKVVcUlo/0pSqv2Uo8X9GKspeLF kIQHC/9qfA8NkdVphP9gpGmrjfwXyXJgkE0cfHw0ToeWMZHAGe1rSE8zlb0NOCrEd3 8Py/EIBBA+0A8igYR+rev85Ac5ZXBOYREYl3lbPs= Received: by b-5.in.mailobj.net [192.168.90.15] with ESMTP via [213.182.55.206] Wed, 26 Oct 2022 12:37:21 +0200 (CEST) X-EA-Auth: H2CtVnUc+erUdiJhAzCjTta69U9/k8Kq8sa4I6xa+4zRi0CNntGfIIw5oc42fnlqqx4kU74pVOSz5wALBQUyjFZB9nU7T7yB Date: Wed, 26 Oct 2022 08:58:44 +0530 From: Deepak R Varma <drv@mailo.com> To: outreachy@lists.linux.dev, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] staging: rtl8192u: remove unused macro definition Message-ID: <b7053d8737c048d6a878609f0ec24d66b18c5abd.1666754500.git.drv@mailo.com> References: <cover.1666754500.git.drv@mailo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <cover.1666754500.git.drv@mailo.com> X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DATE_IN_PAST_06_12, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747746543763418161?= X-GMAIL-MSGID: =?utf-8?q?1747746543763418161?= |
Series |
staging: rtl8192u: unused code cleanup
|
|
Commit Message
Deepak R Varma
Oct. 26, 2022, 3:28 a.m. UTC
Pre-processor macros that are defined but are never used should be
cleaned up to avoid unexpected usage.
Signed-off-by: Deepak R Varma <drv@mailo.com>
---
drivers/staging/rtl8192u/ieee80211/ieee80211.h | 2 --
1 file changed, 2 deletions(-)
--
2.30.2
Comments
On Wed, Oct 26, 2022 at 08:58:44AM +0530, Deepak R Varma wrote: > Pre-processor macros that are defined but are never used should be > cleaned up to avoid unexpected usage. > > Signed-off-by: Deepak R Varma <drv@mailo.com> > --- > drivers/staging/rtl8192u/ieee80211/ieee80211.h | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h > index 00c07455cbb3..0b3dda59d7c0 100644 > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h > @@ -230,8 +230,6 @@ struct cb_desc { > #define ieee80211_unregister_crypto_ops ieee80211_unregister_crypto_ops_rsl > #define ieee80211_get_crypto_ops ieee80211_get_crypto_ops_rsl > > -#define ieee80211_ccmp_null ieee80211_ccmp_null_rsl > - > #define free_ieee80211 free_ieee80211_rsl > #define alloc_ieee80211 alloc_ieee80211_rsl These #defines are a mess, please look into unwinding them as they should not be needed at all. thanks, greg k-h
On Wed, Oct 26, 2022 at 03:14:23PM +0200, Greg Kroah-Hartman wrote: > On Wed, Oct 26, 2022 at 08:58:44AM +0530, Deepak R Varma wrote: > > Pre-processor macros that are defined but are never used should be > > cleaned up to avoid unexpected usage. > > > > Signed-off-by: Deepak R Varma <drv@mailo.com> > > --- > > drivers/staging/rtl8192u/ieee80211/ieee80211.h | 2 -- > > 1 file changed, 2 deletions(-) > > > > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > index 00c07455cbb3..0b3dda59d7c0 100644 > > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > @@ -230,8 +230,6 @@ struct cb_desc { > > #define ieee80211_unregister_crypto_ops ieee80211_unregister_crypto_ops_rsl > > #define ieee80211_get_crypto_ops ieee80211_get_crypto_ops_rsl > > > > -#define ieee80211_ccmp_null ieee80211_ccmp_null_rsl > > - > > #define free_ieee80211 free_ieee80211_rsl > > #define alloc_ieee80211 alloc_ieee80211_rsl > > These #defines are a mess, please look into unwinding them as they > should not be needed at all. Hello Greg, I would like to know what you mean by "unwind them". Is there a documentation or past commit that I can review to understand the expectations better? Thank you, ./drv > > thanks, > > greg k-h >
On Wed, Oct 26, 2022 at 07:14:43PM +0530, Deepak R Varma wrote: > On Wed, Oct 26, 2022 at 03:14:23PM +0200, Greg Kroah-Hartman wrote: > > On Wed, Oct 26, 2022 at 08:58:44AM +0530, Deepak R Varma wrote: > > > Pre-processor macros that are defined but are never used should be > > > cleaned up to avoid unexpected usage. > > > > > > Signed-off-by: Deepak R Varma <drv@mailo.com> > > > --- > > > drivers/staging/rtl8192u/ieee80211/ieee80211.h | 2 -- > > > 1 file changed, 2 deletions(-) > > > > > > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > > index 00c07455cbb3..0b3dda59d7c0 100644 > > > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > > @@ -230,8 +230,6 @@ struct cb_desc { > > > #define ieee80211_unregister_crypto_ops ieee80211_unregister_crypto_ops_rsl > > > #define ieee80211_get_crypto_ops ieee80211_get_crypto_ops_rsl > > > > > > -#define ieee80211_ccmp_null ieee80211_ccmp_null_rsl > > > - > > > #define free_ieee80211 free_ieee80211_rsl > > > #define alloc_ieee80211 alloc_ieee80211_rsl > > > > These #defines are a mess, please look into unwinding them as they > > should not be needed at all. > > Hello Greg, > I would like to know what you mean by "unwind them". Is there a documentation or past > commit that I can review to understand the expectations better? Look at them and try to figure out why they are there, and then work to remove them entirely. A define like this is very odd in the kernel, it should not be needed at all, right? thanks, greg k-h
On Wed, Oct 26, 2022 at 03:55:01PM +0200, Greg Kroah-Hartman wrote: > On Wed, Oct 26, 2022 at 07:14:43PM +0530, Deepak R Varma wrote: > > On Wed, Oct 26, 2022 at 03:14:23PM +0200, Greg Kroah-Hartman wrote: > > > On Wed, Oct 26, 2022 at 08:58:44AM +0530, Deepak R Varma wrote: > > > > Pre-processor macros that are defined but are never used should be > > > > cleaned up to avoid unexpected usage. > > > > > > > > Signed-off-by: Deepak R Varma <drv@mailo.com> > > > > --- > > > > drivers/staging/rtl8192u/ieee80211/ieee80211.h | 2 -- > > > > 1 file changed, 2 deletions(-) > > > > > > > > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > > > index 00c07455cbb3..0b3dda59d7c0 100644 > > > > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > > > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > > > @@ -230,8 +230,6 @@ struct cb_desc { > > > > #define ieee80211_unregister_crypto_ops ieee80211_unregister_crypto_ops_rsl > > > > #define ieee80211_get_crypto_ops ieee80211_get_crypto_ops_rsl > > > > > > > > -#define ieee80211_ccmp_null ieee80211_ccmp_null_rsl > > > > - > > > > #define free_ieee80211 free_ieee80211_rsl > > > > #define alloc_ieee80211 alloc_ieee80211_rsl > > > > > > These #defines are a mess, please look into unwinding them as they > > > should not be needed at all. > > > > Hello Greg, > > I would like to know what you mean by "unwind them". Is there a documentation or past > > commit that I can review to understand the expectations better? > > Look at them and try to figure out why they are there, and then work to > remove them entirely. A define like this is very odd in the kernel, it > should not be needed at all, right? Hello Greg, I will look into these additional macros soon and send any further edits as a separate patch (set). Is the current patch set with 2 patches acceptable? Also, I am trying to get Coccinelle to work on my machine. Trying to work through strange issues. I will work on the macro unwinding task you suggested once a get the Coccinelle task completed. Thank you, ./drv > > thanks, > > greg k-h >
On Fri, Oct 28, 2022 at 01:03:36AM +0530, Deepak Varma wrote: > On Wed, Oct 26, 2022 at 03:55:01PM +0200, Greg Kroah-Hartman wrote: > > On Wed, Oct 26, 2022 at 07:14:43PM +0530, Deepak R Varma wrote: > > > On Wed, Oct 26, 2022 at 03:14:23PM +0200, Greg Kroah-Hartman wrote: > > > > On Wed, Oct 26, 2022 at 08:58:44AM +0530, Deepak R Varma wrote: > > > > > Pre-processor macros that are defined but are never used should be > > > > > cleaned up to avoid unexpected usage. > > > > > > > > > > Signed-off-by: Deepak R Varma <drv@mailo.com> > > > > > --- > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211.h | 2 -- > > > > > 1 file changed, 2 deletions(-) > > > > > > > > > > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > > > > index 00c07455cbb3..0b3dda59d7c0 100644 > > > > > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > > > > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > > > > @@ -230,8 +230,6 @@ struct cb_desc { > > > > > #define ieee80211_unregister_crypto_ops ieee80211_unregister_crypto_ops_rsl > > > > > #define ieee80211_get_crypto_ops ieee80211_get_crypto_ops_rsl > > > > > > > > > > -#define ieee80211_ccmp_null ieee80211_ccmp_null_rsl > > > > > - > > > > > #define free_ieee80211 free_ieee80211_rsl > > > > > #define alloc_ieee80211 alloc_ieee80211_rsl > > > > > > > > These #defines are a mess, please look into unwinding them as they > > > > should not be needed at all. > > > > > > Hello Greg, > > > I would like to know what you mean by "unwind them". Is there a documentation or past > > > commit that I can review to understand the expectations better? > > > > Look at them and try to figure out why they are there, and then work to > > remove them entirely. A define like this is very odd in the kernel, it > > should not be needed at all, right? > > Hello Greg, > I will look into these additional macros soon and send any further edits as a > separate patch (set). Is the current patch set with 2 patches acceptable? > > Also, I am trying to get Coccinelle to work on my machine. Trying to work > through strange issues. I will work on the macro unwinding task you suggested > once a get the Coccinelle task completed. Hello Greg, Most of these macro defines appear to be unused in the module anywhere. I can simply delete the #defines for these and let the original function names be retained. The other way is to rename the functions by the defined value. So, we will have to make the code change to use the foo_rsl symbol names at all places. This will be a bigger change involving the API name change itself. I am unable to determine the initial intention as to why these #defines were added. Can you please suggest what would be the recommended way for the clean up of these unused macros? Thank you, ./drv > > Thank you, > ./drv > > > > > thanks, > > > > greg k-h > > > > >
On Mon, 31 Oct 2022, Deepak R Varma wrote: > On Fri, Oct 28, 2022 at 01:03:36AM +0530, Deepak Varma wrote: > > On Wed, Oct 26, 2022 at 03:55:01PM +0200, Greg Kroah-Hartman wrote: > > > On Wed, Oct 26, 2022 at 07:14:43PM +0530, Deepak R Varma wrote: > > > > On Wed, Oct 26, 2022 at 03:14:23PM +0200, Greg Kroah-Hartman wrote: > > > > > On Wed, Oct 26, 2022 at 08:58:44AM +0530, Deepak R Varma wrote: > > > > > > Pre-processor macros that are defined but are never used should be > > > > > > cleaned up to avoid unexpected usage. > > > > > > > > > > > > Signed-off-by: Deepak R Varma <drv@mailo.com> > > > > > > --- > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211.h | 2 -- > > > > > > 1 file changed, 2 deletions(-) > > > > > > > > > > > > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > > > > > index 00c07455cbb3..0b3dda59d7c0 100644 > > > > > > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > > > > > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > > > > > @@ -230,8 +230,6 @@ struct cb_desc { > > > > > > #define ieee80211_unregister_crypto_ops ieee80211_unregister_crypto_ops_rsl > > > > > > #define ieee80211_get_crypto_ops ieee80211_get_crypto_ops_rsl > > > > > > > > > > > > -#define ieee80211_ccmp_null ieee80211_ccmp_null_rsl > > > > > > - > > > > > > #define free_ieee80211 free_ieee80211_rsl > > > > > > #define alloc_ieee80211 alloc_ieee80211_rsl > > > > > > > > > > These #defines are a mess, please look into unwinding them as they > > > > > should not be needed at all. > > > > > > > > Hello Greg, > > > > I would like to know what you mean by "unwind them". Is there a documentation or past > > > > commit that I can review to understand the expectations better? > > > > > > Look at them and try to figure out why they are there, and then work to > > > remove them entirely. A define like this is very odd in the kernel, it > > > should not be needed at all, right? > > > > Hello Greg, > > I will look into these additional macros soon and send any further edits as a > > separate patch (set). Is the current patch set with 2 patches acceptable? > > > > Also, I am trying to get Coccinelle to work on my machine. Trying to work > > through strange issues. I will work on the macro unwinding task you suggested > > once a get the Coccinelle task completed. > > Hello Greg, > Most of these macro defines appear to be unused in the module anywhere. > I can simply delete the #defines for these and let the original function > names be retained. > The other way is to rename the functions by the defined value. So, we will have > to make the code change to use the foo_rsl symbol names at all places. This will > be a bigger change involving the API name change itself. I'm not sure to understand. In the case of #define abc def If abc is never used, it would seem that you could just remove the macro definition. If abc is used, one might consider whether the renaming is worth it, or whether the abc's should be changed to def. Or maybe def is a very simple function, that just calls some standard kernel function like kfree, in which can you could get rid of both abc and def everywhere and just use kfree. It is often better to use standard functions, because it makes it easier for people to understand immediately what is going on. julia > > I am unable to determine the initial intention as to why these #defines were > added. Can you please suggest what would be the recommended way for the clean up > of these unused macros? > > Thank you, > ./drv > > > > > Thank you, > > ./drv > > > > > > > > thanks, > > > > > > greg k-h > > > > > > > > > > > > >
On Mon, Oct 31, 2022 at 03:55:59PM +0100, Julia Lawall wrote: > > > On Mon, 31 Oct 2022, Deepak R Varma wrote: > > > On Fri, Oct 28, 2022 at 01:03:36AM +0530, Deepak Varma wrote: > > > On Wed, Oct 26, 2022 at 03:55:01PM +0200, Greg Kroah-Hartman wrote: > > > > On Wed, Oct 26, 2022 at 07:14:43PM +0530, Deepak R Varma wrote: > > > > > On Wed, Oct 26, 2022 at 03:14:23PM +0200, Greg Kroah-Hartman wrote: > > > > > > On Wed, Oct 26, 2022 at 08:58:44AM +0530, Deepak R Varma wrote: > > > > > > > Pre-processor macros that are defined but are never used should be > > > > > > > cleaned up to avoid unexpected usage. > > > > > > > > > > > > > > Signed-off-by: Deepak R Varma <drv@mailo.com> > > > > > > > --- > > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211.h | 2 -- > > > > > > > 1 file changed, 2 deletions(-) > > > > > > > > > > > > > > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > > > > > > index 00c07455cbb3..0b3dda59d7c0 100644 > > > > > > > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > > > > > > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > > > > > > @@ -230,8 +230,6 @@ struct cb_desc { > > > > > > > #define ieee80211_unregister_crypto_ops ieee80211_unregister_crypto_ops_rsl > > > > > > > #define ieee80211_get_crypto_ops ieee80211_get_crypto_ops_rsl > > > > > > > > > > > > > > -#define ieee80211_ccmp_null ieee80211_ccmp_null_rsl > > > > > > > - > > > > > > > #define free_ieee80211 free_ieee80211_rsl > > > > > > > #define alloc_ieee80211 alloc_ieee80211_rsl > > > > > > > > > > > > These #defines are a mess, please look into unwinding them as they > > > > > > should not be needed at all. > > > > > > > > > > Hello Greg, > > > > > I would like to know what you mean by "unwind them". Is there a documentation or past > > > > > commit that I can review to understand the expectations better? > > > > > > > > Look at them and try to figure out why they are there, and then work to > > > > remove them entirely. A define like this is very odd in the kernel, it > > > > should not be needed at all, right? > > > > > > Hello Greg, > > > I will look into these additional macros soon and send any further edits as a > > > separate patch (set). Is the current patch set with 2 patches acceptable? > > > > > > Also, I am trying to get Coccinelle to work on my machine. Trying to work > > > through strange issues. I will work on the macro unwinding task you suggested > > > once a get the Coccinelle task completed. > > > > Hello Greg, > > Most of these macro defines appear to be unused in the module anywhere. > > I can simply delete the #defines for these and let the original function > > names be retained. > > The other way is to rename the functions by the defined value. So, we will have > > to make the code change to use the foo_rsl symbol names at all places. This will > > be a bigger change involving the API name change itself. > > I'm not sure to understand. In the case of My apologies for not being clear in my message. > > #define abc def > > If abc is never used, it would seem that you could just remove the macro > definition. The module uses abc at all places in the code. It gets simply replaced by abc_rsl symbol name at compile time. I am unable to determine the utility of this compile time conversion. So, to clean it up, we can continue to use abc in the code (by simply removing the #define line) or make code changes to use abc_rsl (makes the #define line redundant and be deleted). Hope this helps. My question: should we use abc or def in the code? The only hint I have form the code comment is this line: // added for kernel conflict > > If abc is used, one might consider whether the renaming is worth it, or > whether the abc's should be changed to def. Or maybe def is a very simple > function, that just calls some standard kernel function like kfree, in > which can you could get rid of both abc and def everywhere and just use > kfree. > > It is often better to use standard functions, because it makes it easier > for people to understand immediately what is going on. Thank you so much for the explanation. Since the initial intention is not clear to me, I am unable to decide the go forward name for these functions. May I request to look at one of the macro implementations and make suggestion? > > julia > > > > > > I am unable to determine the initial intention as to why these #defines were > > added. Can you please suggest what would be the recommended way for the clean up > > of these unused macros? > > > > Thank you, > > ./drv > > > > > > > > Thank you, > > > ./drv > > > > > > > > > > > thanks, > > > > > > > > greg k-h > > > > > > > > > > > > > > > > > > > > >
On Mon, 31 Oct 2022, Deepak R Varma wrote: > On Mon, Oct 31, 2022 at 03:55:59PM +0100, Julia Lawall wrote: > > > > > > On Mon, 31 Oct 2022, Deepak R Varma wrote: > > > > > On Fri, Oct 28, 2022 at 01:03:36AM +0530, Deepak Varma wrote: > > > > On Wed, Oct 26, 2022 at 03:55:01PM +0200, Greg Kroah-Hartman wrote: > > > > > On Wed, Oct 26, 2022 at 07:14:43PM +0530, Deepak R Varma wrote: > > > > > > On Wed, Oct 26, 2022 at 03:14:23PM +0200, Greg Kroah-Hartman wrote: > > > > > > > On Wed, Oct 26, 2022 at 08:58:44AM +0530, Deepak R Varma wrote: > > > > > > > > Pre-processor macros that are defined but are never used should be > > > > > > > > cleaned up to avoid unexpected usage. > > > > > > > > > > > > > > > > Signed-off-by: Deepak R Varma <drv@mailo.com> > > > > > > > > --- > > > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211.h | 2 -- > > > > > > > > 1 file changed, 2 deletions(-) > > > > > > > > > > > > > > > > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > > > > > > > index 00c07455cbb3..0b3dda59d7c0 100644 > > > > > > > > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > > > > > > > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > > > > > > > @@ -230,8 +230,6 @@ struct cb_desc { > > > > > > > > #define ieee80211_unregister_crypto_ops ieee80211_unregister_crypto_ops_rsl > > > > > > > > #define ieee80211_get_crypto_ops ieee80211_get_crypto_ops_rsl > > > > > > > > > > > > > > > > -#define ieee80211_ccmp_null ieee80211_ccmp_null_rsl > > > > > > > > - > > > > > > > > #define free_ieee80211 free_ieee80211_rsl > > > > > > > > #define alloc_ieee80211 alloc_ieee80211_rsl > > > > > > > > > > > > > > These #defines are a mess, please look into unwinding them as they > > > > > > > should not be needed at all. > > > > > > > > > > > > Hello Greg, > > > > > > I would like to know what you mean by "unwind them". Is there a documentation or past > > > > > > commit that I can review to understand the expectations better? > > > > > > > > > > Look at them and try to figure out why they are there, and then work to > > > > > remove them entirely. A define like this is very odd in the kernel, it > > > > > should not be needed at all, right? > > > > > > > > Hello Greg, > > > > I will look into these additional macros soon and send any further edits as a > > > > separate patch (set). Is the current patch set with 2 patches acceptable? > > > > > > > > Also, I am trying to get Coccinelle to work on my machine. Trying to work > > > > through strange issues. I will work on the macro unwinding task you suggested > > > > once a get the Coccinelle task completed. > > > > > > Hello Greg, > > > Most of these macro defines appear to be unused in the module anywhere. > > > I can simply delete the #defines for these and let the original function > > > names be retained. > > > The other way is to rename the functions by the defined value. So, we will have > > > to make the code change to use the foo_rsl symbol names at all places. This will > > > be a bigger change involving the API name change itself. > > > > I'm not sure to understand. In the case of > > My apologies for not being clear in my message. > > > > #define abc def > > > > If abc is never used, it would seem that you could just remove the macro > > definition. > > The module uses abc at all places in the code. It gets simply replaced by > abc_rsl symbol name at compile time. I am unable to determine the utility of > this compile time conversion. So, to clean it up, we can continue to use abc > in the code (by simply removing the #define line) or make code changes to use > abc_rsl (makes the #define line redundant and be deleted). > > Hope this helps. > My question: should we use abc or def in the code? The only hint I have form the > code comment is this line: > // added for kernel conflict > > > > > If abc is used, one might consider whether the renaming is worth it, or > > whether the abc's should be changed to def. Or maybe def is a very simple > > function, that just calls some standard kernel function like kfree, in > > which can you could get rid of both abc and def everywhere and just use > > kfree. > > > > It is often better to use standard functions, because it makes it easier > > for people to understand immediately what is going on. > > Thank you so much for the explanation. Since the initial intention is not clear > to me, I am unable to decide the go forward name for these functions. > > May I request to look at one of the macro implementations and make suggestion? Ah, ok I see, these macros replace both the names at the uses of eg free_ieee80211, but also the name at the point of the definition. But the name free_ieee80211 isn't used elsewhere in the kernel source tree, so it would seem that changing the name is useless. Maybe the purpose was to link this code with some other code that also uses the name free_ieee80211, but that other code doesn't seem to be part of the kernel. At least, you could propose a patch that removes these definitions and explains clearly what the impact is, and see if the maintainers of the driver complain. julia > > > > > julia > > > > > > > > > > I am unable to determine the initial intention as to why these #defines were > > > added. Can you please suggest what would be the recommended way for the clean up > > > of these unused macros? > > > > > > Thank you, > > > ./drv > > > > > > > > > > > Thank you, > > > > ./drv > > > > > > > > > > > > > > thanks, > > > > > > > > > > greg k-h > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
On Mon, Oct 31, 2022 at 04:37:38PM +0100, Julia Lawall wrote: > > > On Mon, 31 Oct 2022, Deepak R Varma wrote: > > > On Mon, Oct 31, 2022 at 03:55:59PM +0100, Julia Lawall wrote: > > > > > > > > > On Mon, 31 Oct 2022, Deepak R Varma wrote: > > > > > > > On Fri, Oct 28, 2022 at 01:03:36AM +0530, Deepak Varma wrote: > > > > > On Wed, Oct 26, 2022 at 03:55:01PM +0200, Greg Kroah-Hartman wrote: > > > > > > On Wed, Oct 26, 2022 at 07:14:43PM +0530, Deepak R Varma wrote: > > > > > > > On Wed, Oct 26, 2022 at 03:14:23PM +0200, Greg Kroah-Hartman wrote: > > > > > > > > On Wed, Oct 26, 2022 at 08:58:44AM +0530, Deepak R Varma wrote: > > > > > > > > > Pre-processor macros that are defined but are never used should be > > > > > > > > > cleaned up to avoid unexpected usage. > > > > > > > > > > > > > > > > > > Signed-off-by: Deepak R Varma <drv@mailo.com> > > > > > > > > > --- > > > > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211.h | 2 -- > > > > > > > > > 1 file changed, 2 deletions(-) > > > > > > > > > > > > > > > > > > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > > > > > > > > index 00c07455cbb3..0b3dda59d7c0 100644 > > > > > > > > > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > > > > > > > > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h > > > > > > > > > @@ -230,8 +230,6 @@ struct cb_desc { > > > > > > > > > #define ieee80211_unregister_crypto_ops ieee80211_unregister_crypto_ops_rsl > > > > > > > > > #define ieee80211_get_crypto_ops ieee80211_get_crypto_ops_rsl > > > > > > > > > > > > > > > > > > -#define ieee80211_ccmp_null ieee80211_ccmp_null_rsl > > > > > > > > > - > > > > > > > > > #define free_ieee80211 free_ieee80211_rsl > > > > > > > > > #define alloc_ieee80211 alloc_ieee80211_rsl > > > > > > > > > > > > > > > > These #defines are a mess, please look into unwinding them as they > > > > > > > > should not be needed at all. > > > > > > > > > > > > > > Hello Greg, > > > > > > > I would like to know what you mean by "unwind them". Is there a documentation or past > > > > > > > commit that I can review to understand the expectations better? > > > > > > > > > > > > Look at them and try to figure out why they are there, and then work to > > > > > > remove them entirely. A define like this is very odd in the kernel, it > > > > > > should not be needed at all, right? > > > > > > > > > > Hello Greg, > > > > > I will look into these additional macros soon and send any further edits as a > > > > > separate patch (set). Is the current patch set with 2 patches acceptable? > > > > > > > > > > Also, I am trying to get Coccinelle to work on my machine. Trying to work > > > > > through strange issues. I will work on the macro unwinding task you suggested > > > > > once a get the Coccinelle task completed. > > > > > > > > Hello Greg, > > > > Most of these macro defines appear to be unused in the module anywhere. > > > > I can simply delete the #defines for these and let the original function > > > > names be retained. > > > > The other way is to rename the functions by the defined value. So, we will have > > > > to make the code change to use the foo_rsl symbol names at all places. This will > > > > be a bigger change involving the API name change itself. > > > > > > I'm not sure to understand. In the case of > > > > My apologies for not being clear in my message. > > > > > > #define abc def > > > > > > If abc is never used, it would seem that you could just remove the macro > > > definition. > > > > The module uses abc at all places in the code. It gets simply replaced by > > abc_rsl symbol name at compile time. I am unable to determine the utility of > > this compile time conversion. So, to clean it up, we can continue to use abc > > in the code (by simply removing the #define line) or make code changes to use > > abc_rsl (makes the #define line redundant and be deleted). > > > > Hope this helps. > > My question: should we use abc or def in the code? The only hint I have form the > > code comment is this line: > > // added for kernel conflict > > > > > > > > If abc is used, one might consider whether the renaming is worth it, or > > > whether the abc's should be changed to def. Or maybe def is a very simple > > > function, that just calls some standard kernel function like kfree, in > > > which can you could get rid of both abc and def everywhere and just use > > > kfree. > > > > > > It is often better to use standard functions, because it makes it easier > > > for people to understand immediately what is going on. > > > > Thank you so much for the explanation. Since the initial intention is not clear > > to me, I am unable to decide the go forward name for these functions. > > > > May I request to look at one of the macro implementations and make suggestion? > > Ah, ok I see, these macros replace both the names at the uses of eg > free_ieee80211, but also the name at the point of the definition. > > But the name free_ieee80211 isn't used elsewhere in the kernel source > tree, so it would seem that changing the name is useless. > > Maybe the purpose was to link this code with some other code that also > uses the name free_ieee80211, but that other code doesn't seem to be part > of the kernel. > > At least, you could propose a patch that removes these definitions and > explains clearly what the impact is, and see if the maintainers of the > driver complain. Thank you so much. I will send in the proposed patch shortly. ./drv > > julia > > > > > > > > > julia > > > > > > > > > > > > > > I am unable to determine the initial intention as to why these #defines were > > > > added. Can you please suggest what would be the recommended way for the clean up > > > > of these unused macros? > > > > > > > > Thank you, > > > > ./drv > > > > > > > > > > > > > > Thank you, > > > > > ./drv > > > > > > > > > > > > > > > > > thanks, > > > > > > > > > > > > greg k-h > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index 00c07455cbb3..0b3dda59d7c0 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -230,8 +230,6 @@ struct cb_desc { #define ieee80211_unregister_crypto_ops ieee80211_unregister_crypto_ops_rsl #define ieee80211_get_crypto_ops ieee80211_get_crypto_ops_rsl -#define ieee80211_ccmp_null ieee80211_ccmp_null_rsl - #define free_ieee80211 free_ieee80211_rsl #define alloc_ieee80211 alloc_ieee80211_rsl