public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH v5 0/4] Remove unused rf_set_sens variable
@ 2023-04-24 18:03 Yogesh Hegde
  2023-04-24 18:04 ` [PATCH v5 1/4] staging: rtl8192e: " Yogesh Hegde
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Yogesh Hegde @ 2023-04-24 18:03 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

The rf_set_sens variable is declared but never set, so it is always NULL.
Cleanup the unused rf_set_sens variable. Remove functions
_rtl92e_wx_get_sens and _rtl92e_wx_set_sens which always returned 
error code after removal of rf_set_sens variable. 
Cleanup unused max_sens and sens variable.
The patches are required to be applied in sequence.

Changes in v5:
    1. Rebased onto latest staging-testing branch per feedback from
       philipp.g.hortmann@gmail.com

Changes in v4:
    1. Split changes into patch series per feedback from
       gregkh@linuxfoundation.org

Changes in v3:
    1. Fixed description to fit within 75 chars
    2. Added suggested tags
    per feedback from philipp.g.hortmann@gmail.com

Changes in v2:
    1. Removed function definition rf_set_sens
    2. Removed usage of variable priv->rf_set_sens
    3. Removed functions _rtl92e_wx_get_sens and _rtl92e_wx_set_sens
    4. Cleaned up the variables sens and max_sens used in these functions

Changes in v1:
    1. Fix comparison to NULL of variable rf_set_sens

Yogesh Hegde (4):
  staging: rtl8192e: Remove unused rf_set_sens variable
  staging: rtl8192e: Remove unused _rtl92e_wx_get_sens function
  staging: rtl8192e: Remove unused _rtl92e_wx_set_sens function
  staging: rtl8192e: Remove unused sens and max_sens from r8192_priv
    struct

 drivers/staging/rtl8192e/rtl8192e/rtl_core.h |  3 --
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c   | 45 --------------------
 2 files changed, 48 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v5 1/4] staging: rtl8192e: Remove unused rf_set_sens variable
  2023-04-24 18:03 [PATCH v5 0/4] Remove unused rf_set_sens variable Yogesh Hegde
@ 2023-04-24 18:04 ` Yogesh Hegde
  2023-04-24 18:04 ` [PATCH v5 2/4] staging: rtl8192e: Remove unused _rtl92e_wx_get_sens function Yogesh Hegde
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Yogesh Hegde @ 2023-04-24 18:04 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

The rf_set_sens variable is declared but never set, so it is always NULL.
This commit cleans up the unused rf_set_sens variable and removes the
associated code that relied on it.

Specifically, the following changes have been made:
- Removed the `range->sensitivity` assignment, which was never used.
- Removed the sensitivity level get implementation, which always returns
  an error code.
- Removed the sensitivity level set implementation, which always returns
  an error code.
- Removed the `rf_set_sens` variable.

Suggested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Signed-off-by: Yogesh Hegde <yogi.kernel@gmail.com>
---

Changes in v5:
    1. Rebased onto latest staging-testing branch

Changes in v4:
    1. Split changes into patch series per feedback from
       gregkh@linuxfoundation.org

Changes in v3:
    1. Fixed description to fit within 75 chars
    2. Added suggested tags
    per feedback from philipp.g.hortmann@gmail.com

Changes in v2:
    1. Removed function definition rf_set_sens
    2. Removed usage of variable priv->rf_set_sens
    3. Removed functions _rtl92e_wx_get_sens and _rtl92e_wx_set_sens
    4. Cleaned up the variables sens and max_sens used in these functions

Changes in v1:
    1. Fix comparison to NULL of variable rf_set_sens
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.h |  1 -
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c   | 19 ++-----------------
 2 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index 285dac32c074..08145e1f814c 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -231,7 +231,6 @@ struct r8192_priv {
 	struct rt_stats stats;
 	struct iw_statistics			wstats;
 
-	short (*rf_set_sens)(struct net_device *dev, short sens);
 	u8 (*rf_set_chan)(struct net_device *dev, u8 ch);
 
 	struct rx_desc *rx_ring[MAX_RX_QUEUE];
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index cb28288a618b..cc1af367f37d 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -311,10 +311,6 @@ static int _rtl92e_wx_get_range(struct net_device *dev,
 	/* ~130 Mb/s real (802.11n) */
 	range->throughput = 130 * 1000 * 1000;
 
-	if (priv->rf_set_sens != NULL)
-		/* signal level threshold range */
-		range->sensitivity = priv->max_sens;
-
 	range->max_qual.qual = 100;
 	range->max_qual.level = 0;
 	range->max_qual.noise = 0;
@@ -813,10 +809,7 @@ static int _rtl92e_wx_get_sens(struct net_device *dev,
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
 
-	if (priv->rf_set_sens == NULL)
-		return -1; /* we have not this support for this radio */
-	wrqu->sens.value = priv->sens;
-	return 0;
+	return -1;
 }
 
 static int _rtl92e_wx_set_sens(struct net_device *dev,
@@ -831,15 +824,7 @@ static int _rtl92e_wx_set_sens(struct net_device *dev,
 		return 0;
 
 	mutex_lock(&priv->wx_mutex);
-	if (priv->rf_set_sens == NULL) {
-		err = -1; /* we have not this support for this radio */
-		goto exit;
-	}
-	if (priv->rf_set_sens(dev, wrqu->sens.value) == 0)
-		priv->sens = wrqu->sens.value;
-	else
-		err = -EINVAL;
-
+	err = -1;
 exit:
 	mutex_unlock(&priv->wx_mutex);
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v5 2/4] staging: rtl8192e: Remove unused _rtl92e_wx_get_sens function
  2023-04-24 18:03 [PATCH v5 0/4] Remove unused rf_set_sens variable Yogesh Hegde
  2023-04-24 18:04 ` [PATCH v5 1/4] staging: rtl8192e: " Yogesh Hegde
@ 2023-04-24 18:04 ` Yogesh Hegde
  2023-04-24 18:05 ` [PATCH v5 3/4] staging: rtl8192e: Remove unused _rtl92e_wx_set_sens function^[ Yogesh Hegde
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Yogesh Hegde @ 2023-04-24 18:04 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

After removal of rf_set_sens variable, the _rtl92e_wx_get_sens function
always returns an error code.
This commit removes the unused function and the respective ioctl.

Suggested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Signed-off-by: Yogesh Hegde <yogi.kernel@gmail.com>
---

Changes in v5:
    1. Rebased onto latest staging-testing branch

Changes in v4:
    1. Split changes into patch series per feedback from
       gregkh@linuxfoundation.org

Changes in v3:
    -- None

Changes in v2:
    -- None

Changes in v1:
    -- None
---
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index cc1af367f37d..f0c590064def 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -803,15 +803,6 @@ static int _rtl92e_wx_get_retry(struct net_device *dev,
 	return 0;
 }
 
-static int _rtl92e_wx_get_sens(struct net_device *dev,
-			       struct iw_request_info *info,
-			       union iwreq_data *wrqu, char *extra)
-{
-	struct r8192_priv *priv = rtllib_priv(dev);
-
-	return -1;
-}
-
 static int _rtl92e_wx_set_sens(struct net_device *dev,
 			       struct iw_request_info *info,
 			       union iwreq_data *wrqu, char *extra)
@@ -1052,7 +1043,6 @@ static iw_handler r8192_wx_handlers[] = {
 	[IW_IOCTL(SIOCSIWMODE)] = _rtl92e_wx_set_mode,
 	[IW_IOCTL(SIOCGIWMODE)] = _rtl92e_wx_get_mode,
 	[IW_IOCTL(SIOCSIWSENS)] = _rtl92e_wx_set_sens,
-	[IW_IOCTL(SIOCGIWSENS)] = _rtl92e_wx_get_sens,
 	[IW_IOCTL(SIOCGIWRANGE)] = _rtl92e_wx_get_range,
 	[IW_IOCTL(SIOCSIWAP)] = _rtl92e_wx_set_wap,
 	[IW_IOCTL(SIOCGIWAP)] = _rtl92e_wx_get_wap,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v5 3/4] staging: rtl8192e: Remove unused _rtl92e_wx_set_sens function^[
  2023-04-24 18:03 [PATCH v5 0/4] Remove unused rf_set_sens variable Yogesh Hegde
  2023-04-24 18:04 ` [PATCH v5 1/4] staging: rtl8192e: " Yogesh Hegde
  2023-04-24 18:04 ` [PATCH v5 2/4] staging: rtl8192e: Remove unused _rtl92e_wx_get_sens function Yogesh Hegde
@ 2023-04-24 18:05 ` Yogesh Hegde
  2023-04-24 18:05 ` [PATCH v5 4/4] staging: rtl8192e: Remove unused sens and max_sens from r8192_priv struct Yogesh Hegde
  2023-04-24 18:37 ` [PATCH v5 0/4] Remove unused rf_set_sens variable Philipp Hortmann
  4 siblings, 0 replies; 6+ messages in thread
From: Yogesh Hegde @ 2023-04-24 18:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

After removal of rf_set_sens variable, the _rtl92e_wx_set_sens function
always returns an error code.
This commit removes the unused function and the respective ioctl.

Suggested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Signed-off-by: Yogesh Hegde <yogi.kernel@gmail.com>
---

Changes in v5:
    1. Rebased onto latest staging-testing branch

Changes in v4:
    1. Split changes into patch series per feedback from
       gregkh@linuxfoundation.org

Changes in v3:
    -- None

Changes in v2:
    -- None

Changes in v1:
    -- None
---
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index f0c590064def..0bb657fda06c 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -803,25 +803,6 @@ static int _rtl92e_wx_get_retry(struct net_device *dev,
 	return 0;
 }
 
-static int _rtl92e_wx_set_sens(struct net_device *dev,
-			       struct iw_request_info *info,
-			       union iwreq_data *wrqu, char *extra)
-{
-	struct r8192_priv *priv = rtllib_priv(dev);
-
-	short err = 0;
-
-	if (priv->hw_radio_off)
-		return 0;
-
-	mutex_lock(&priv->wx_mutex);
-	err = -1;
-exit:
-	mutex_unlock(&priv->wx_mutex);
-
-	return err;
-}
-
 static int _rtl92e_wx_set_encode_ext(struct net_device *dev,
 				     struct iw_request_info *info,
 				     union iwreq_data *wrqu, char *extra)
@@ -1042,7 +1023,6 @@ static iw_handler r8192_wx_handlers[] = {
 	[IW_IOCTL(SIOCGIWFREQ)] = _rtl92e_wx_get_freq,
 	[IW_IOCTL(SIOCSIWMODE)] = _rtl92e_wx_set_mode,
 	[IW_IOCTL(SIOCGIWMODE)] = _rtl92e_wx_get_mode,
-	[IW_IOCTL(SIOCSIWSENS)] = _rtl92e_wx_set_sens,
 	[IW_IOCTL(SIOCGIWRANGE)] = _rtl92e_wx_get_range,
 	[IW_IOCTL(SIOCSIWAP)] = _rtl92e_wx_set_wap,
 	[IW_IOCTL(SIOCGIWAP)] = _rtl92e_wx_get_wap,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v5 4/4] staging: rtl8192e: Remove unused sens and max_sens from r8192_priv struct
  2023-04-24 18:03 [PATCH v5 0/4] Remove unused rf_set_sens variable Yogesh Hegde
                   ` (2 preceding siblings ...)
  2023-04-24 18:05 ` [PATCH v5 3/4] staging: rtl8192e: Remove unused _rtl92e_wx_set_sens function^[ Yogesh Hegde
@ 2023-04-24 18:05 ` Yogesh Hegde
  2023-04-24 18:37 ` [PATCH v5 0/4] Remove unused rf_set_sens variable Philipp Hortmann
  4 siblings, 0 replies; 6+ messages in thread
From: Yogesh Hegde @ 2023-04-24 18:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

The 'sens' and 'max_sens' fields in the 'r8192_priv' structure are no
longer used by the driver. This commit removes these fields.

Suggested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Signed-off-by: Yogesh Hegde <yogi.kernel@gmail.com>
---

Changes in v5:
    1. Rebased onto latest staging-testing branch

Changes in v4:
    1. Split changes into patch series per feedback from
       gregkh@linuxfoundation.org

Changes in v3:
    -- None

Changes in v2:
    -- None

Changes in v1:
    -- None
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index 08145e1f814c..ec9e454299a8 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -270,8 +270,6 @@ struct r8192_priv {
 	short	promisc;
 
 	short	chan;
-	short	sens;
-	short	max_sens;
 	bool ps_force;
 
 	u32 irq_mask[2];
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v5 0/4] Remove unused rf_set_sens variable
  2023-04-24 18:03 [PATCH v5 0/4] Remove unused rf_set_sens variable Yogesh Hegde
                   ` (3 preceding siblings ...)
  2023-04-24 18:05 ` [PATCH v5 4/4] staging: rtl8192e: Remove unused sens and max_sens from r8192_priv struct Yogesh Hegde
@ 2023-04-24 18:37 ` Philipp Hortmann
  4 siblings, 0 replies; 6+ messages in thread
From: Philipp Hortmann @ 2023-04-24 18:37 UTC (permalink / raw)
  To: Yogesh Hegde, Greg Kroah-Hartman, linux-staging, linux-kernel

On 4/24/23 20:03, Yogesh Hegde wrote:
> The rf_set_sens variable is declared but never set, so it is always NULL.
> Cleanup the unused rf_set_sens variable. Remove functions
> _rtl92e_wx_get_sens and _rtl92e_wx_set_sens which always returned
> error code after removal of rf_set_sens variable.
> Cleanup unused max_sens and sens variable.
> The patches are required to be applied in sequence.
> 
> Changes in v5:
>      1. Rebased onto latest staging-testing branch per feedback from
>         philipp.g.hortmann@gmail.com
> 
> Changes in v4:
>      1. Split changes into patch series per feedback from
>         gregkh@linuxfoundation.org
> 
> Changes in v3:
>      1. Fixed description to fit within 75 chars
>      2. Added suggested tags
>      per feedback from philipp.g.hortmann@gmail.com
> 
> Changes in v2:
>      1. Removed function definition rf_set_sens
>      2. Removed usage of variable priv->rf_set_sens
>      3. Removed functions _rtl92e_wx_get_sens and _rtl92e_wx_set_sens
>      4. Cleaned up the variables sens and max_sens used in these functions
> 
> Changes in v1:
>      1. Fix comparison to NULL of variable rf_set_sens
> 
> Yogesh Hegde (4):
>    staging: rtl8192e: Remove unused rf_set_sens variable
>    staging: rtl8192e: Remove unused _rtl92e_wx_get_sens function
>    staging: rtl8192e: Remove unused _rtl92e_wx_set_sens function
>    staging: rtl8192e: Remove unused sens and max_sens from r8192_priv
>      struct
> 
>   drivers/staging/rtl8192e/rtl8192e/rtl_core.h |  3 --
>   drivers/staging/rtl8192e/rtl8192e/rtl_wx.c   | 45 --------------------
>   2 files changed, 48 deletions(-)
> 

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-04-24 18:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-24 18:03 [PATCH v5 0/4] Remove unused rf_set_sens variable Yogesh Hegde
2023-04-24 18:04 ` [PATCH v5 1/4] staging: rtl8192e: " Yogesh Hegde
2023-04-24 18:04 ` [PATCH v5 2/4] staging: rtl8192e: Remove unused _rtl92e_wx_get_sens function Yogesh Hegde
2023-04-24 18:05 ` [PATCH v5 3/4] staging: rtl8192e: Remove unused _rtl92e_wx_set_sens function^[ Yogesh Hegde
2023-04-24 18:05 ` [PATCH v5 4/4] staging: rtl8192e: Remove unused sens and max_sens from r8192_priv struct Yogesh Hegde
2023-04-24 18:37 ` [PATCH v5 0/4] Remove unused rf_set_sens variable Philipp Hortmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox