Linux kernel staging patches
 help / color / Atom feed
* [PATCH v2] staging: rtl8188eu: Remove an unused variable and some lines of code
@ 2021-07-05 13:41 Fabio M. De Francesco
  2021-07-05 13:45 ` Dan Carpenter
  2021-07-21  8:19 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 4+ messages in thread
From: Fabio M. De Francesco @ 2021-07-05 13:41 UTC (permalink / raw)
  To: Larry Finger, Greg Kroah-Hartman, Dan Carpenter, linux-staging,
	linux-kernel
  Cc: Fabio M. De Francesco

Remove set but unused iw_operation_mode[]. This driver doesn't support
SIOCSIWRATE.  It just returns zero and does nothing.  Change it to
return -ENOTSUPP instead.  (This is an API change but we don't expect it
to break anything).

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---

v1->v2: Delete rtw_wx_set_rate() and its association with command
SIOCSIWRATE as suggested by Dan Carpenter <dan.carpenter@oracle.com>

 .../staging/rtl8188eu/os_dep/ioctl_linux.c    | 80 -------------------
 1 file changed, 80 deletions(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
index b958a8d882b0..eef8ed71cdef 100644
--- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
@@ -46,11 +46,6 @@ static u32 rtw_rates[] = {1000000, 2000000, 5500000, 11000000,
 	6000000, 9000000, 12000000, 18000000, 24000000, 36000000,
 	48000000, 54000000};
 
-static const char * const iw_operation_mode[] = {
-	"Auto", "Ad-Hoc", "Managed",  "Master", "Repeater",
-	"Secondary", "Monitor"
-};
-
 void indicate_wx_scan_complete_event(struct adapter *padapter)
 {
 	union iwreq_data wrqu;
@@ -1262,80 +1257,6 @@ static int rtw_wx_get_essid(struct net_device *dev,
 	return 0;
 }
 
-static int rtw_wx_set_rate(struct net_device *dev,
-			   struct iw_request_info *a,
-			   union iwreq_data *wrqu, char *extra)
-{
-	int i;
-	u8 datarates[NumRates];
-	u32	target_rate = wrqu->bitrate.value;
-	u32	fixed = wrqu->bitrate.fixed;
-	u32	ratevalue = 0;
-	u8 mpdatarate[NumRates] = {11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0xff};
-
-	if (target_rate == -1) {
-		ratevalue = 11;
-		goto set_rate;
-	}
-	target_rate /= 100000;
-
-	switch (target_rate) {
-	case 10:
-		ratevalue = 0;
-		break;
-	case 20:
-		ratevalue = 1;
-		break;
-	case 55:
-		ratevalue = 2;
-		break;
-	case 60:
-		ratevalue = 3;
-		break;
-	case 90:
-		ratevalue = 4;
-		break;
-	case 110:
-		ratevalue = 5;
-		break;
-	case 120:
-		ratevalue = 6;
-		break;
-	case 180:
-		ratevalue = 7;
-		break;
-	case 240:
-		ratevalue = 8;
-		break;
-	case 360:
-		ratevalue = 9;
-		break;
-	case 480:
-		ratevalue = 10;
-		break;
-	case 540:
-		ratevalue = 11;
-		break;
-	default:
-		ratevalue = 11;
-		break;
-	}
-
-set_rate:
-
-	for (i = 0; i < NumRates; i++) {
-		if (ratevalue == mpdatarate[i]) {
-			datarates[i] = mpdatarate[i];
-			if (fixed == 0)
-				break;
-		} else {
-			datarates[i] = 0xff;
-		}
-	}
-
-	return 0;
-}
-
 static int rtw_wx_get_rate(struct net_device *dev,
 			   struct iw_request_info *info,
 			   union iwreq_data *wrqu, char *extra)
@@ -2715,7 +2636,6 @@ static iw_handler rtw_handlers[] = {
 	IW_HANDLER(SIOCSIWESSID, rtw_wx_set_essid),
 	IW_HANDLER(SIOCGIWESSID, rtw_wx_get_essid),
 	IW_HANDLER(SIOCGIWNICKN, rtw_wx_get_nick),
-	IW_HANDLER(SIOCSIWRATE, rtw_wx_set_rate),
 	IW_HANDLER(SIOCGIWRATE, rtw_wx_get_rate),
 	IW_HANDLER(SIOCSIWRTS, rtw_wx_set_rts),
 	IW_HANDLER(SIOCGIWRTS, rtw_wx_get_rts),
-- 
2.32.0


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

* Re: [PATCH v2] staging: rtl8188eu: Remove an unused variable and some lines of code
  2021-07-05 13:41 [PATCH v2] staging: rtl8188eu: Remove an unused variable and some lines of code Fabio M. De Francesco
@ 2021-07-05 13:45 ` Dan Carpenter
  2021-07-21  8:19 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2021-07-05 13:45 UTC (permalink / raw)
  To: Fabio M. De Francesco
  Cc: Larry Finger, Greg Kroah-Hartman, linux-staging, linux-kernel

On Mon, Jul 05, 2021 at 03:41:51PM +0200, Fabio M. De Francesco wrote:
> Remove set but unused iw_operation_mode[]. This driver doesn't support
> SIOCSIWRATE.  It just returns zero and does nothing.  Change it to
> return -ENOTSUPP instead.  (This is an API change but we don't expect it
> to break anything).
> 
> Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> ---

Thanks!

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>

regards,
dan carpenter


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

* Re: [PATCH v2] staging: rtl8188eu: Remove an unused variable and some lines of code
  2021-07-05 13:41 [PATCH v2] staging: rtl8188eu: Remove an unused variable and some lines of code Fabio M. De Francesco
  2021-07-05 13:45 ` Dan Carpenter
@ 2021-07-21  8:19 ` Greg Kroah-Hartman
  2021-07-21 11:34   ` Fabio M. De Francesco
  1 sibling, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2021-07-21  8:19 UTC (permalink / raw)
  To: Fabio M. De Francesco
  Cc: Larry Finger, Dan Carpenter, linux-staging, linux-kernel

On Mon, Jul 05, 2021 at 03:41:51PM +0200, Fabio M. De Francesco wrote:
> Remove set but unused iw_operation_mode[]. This driver doesn't support
> SIOCSIWRATE.  It just returns zero and does nothing.  Change it to
> return -ENOTSUPP instead.  (This is an API change but we don't expect it
> to break anything).
> 
> Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> ---
> 
> v1->v2: Delete rtw_wx_set_rate() and its association with command
> SIOCSIWRATE as suggested by Dan Carpenter <dan.carpenter@oracle.com>

Does not apply to my tree :(

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

* Re: [PATCH v2] staging: rtl8188eu: Remove an unused variable and some lines of code
  2021-07-21  8:19 ` Greg Kroah-Hartman
@ 2021-07-21 11:34   ` Fabio M. De Francesco
  0 siblings, 0 replies; 4+ messages in thread
From: Fabio M. De Francesco @ 2021-07-21 11:34 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Dan Carpenter, linux-staging, linux-kernel

On Wednesday, July 21, 2021 10:19:33 AM CEST Greg Kroah-Hartman wrote:
> On Mon, Jul 05, 2021 at 03:41:51PM +0200, Fabio M. De Francesco wrote:
> > Remove set but unused iw_operation_mode[]. This driver doesn't support
> > SIOCSIWRATE.  It just returns zero and does nothing.  Change it to
> > return -ENOTSUPP instead.  (This is an API change but we don't expect it
> > to break anything).
> > 
> > Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
> > Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> > ---
> > 
> > v1->v2: Delete rtw_wx_set_rate() and its association with command
> > SIOCSIWRATE as suggested by Dan Carpenter <dan.carpenter@oracle.com>
> 
> Does not apply to my tree :(
>
Hi Greg,

It cannot apply to your tree because, while it was waiting for acceptance, 
someone else did a large part of the removal of the code related to the 
unsupported SIOCSIWRATE and you applied this other patch.

However, the no more necessary iw_operation_mode[] is still in your tree. So 
I'm about to send a patch that only removes the above-mentioned array.

Thanks,

Fabio




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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-05 13:41 [PATCH v2] staging: rtl8188eu: Remove an unused variable and some lines of code Fabio M. De Francesco
2021-07-05 13:45 ` Dan Carpenter
2021-07-21  8:19 ` Greg Kroah-Hartman
2021-07-21 11:34   ` Fabio M. De Francesco

Linux kernel staging patches

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-staging/0 linux-staging/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-staging linux-staging/ https://lore.kernel.org/linux-staging \
		linux-staging@lists.linux.dev
	public-inbox-index linux-staging

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/dev.linux.lists.linux-staging


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git