Skip to contentSkip to conversation

staging: r8188eu: os_dep: Remove defined but not used variables

PATCH In review Fabio M. De Francesco 3 participants 3 messages Aug 14, 2021 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: r8188eu: os_dep: Remove defined but not used variables

Remove defined but not used const variables. Issues detected by GCC running with -Wunused-const-variable option enabled.

---
 drivers/staging/r8188eu/os_dep/ioctl_linux.c | 21 --------------------
 1 file changed, 21 deletions(-)
drivers/staging/r8188eu/os_dep/ioctl_linux.c +0 -21
index 38ee41f9d2ba..d9fdd83218dc 100644
@@ -84,11 +84,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;
@@ -6666,19 +6661,3 @@ struct iw_handler_def rtw_handlers_def = {
 	.num_private_args = sizeof(rtw_private_args) / sizeof(struct iw_priv_args),
 	.get_wireless_stats = rtw_get_wireless_stats,
 };
-
-/*  copy from net/wireless/wext.c start */
-/* ---------------------------------------------------------------- */
-/*
- * Calculate size of private arguments
- */
-static const char iw_priv_type_size[] = {
-	0,			      /* IW_PRIV_TYPE_NONE */
-	1,			      /* IW_PRIV_TYPE_BYTE */
-	1,			      /* IW_PRIV_TYPE_CHAR */
-	0,			      /* Not defined */
-	sizeof(__u32),		  /* IW_PRIV_TYPE_INT */
-	sizeof(struct iw_freq),	 /* IW_PRIV_TYPE_FLOAT */
-	sizeof(struct sockaddr),	/* IW_PRIV_TYPE_ADDR */
-	0,			      /* Not defined */
-};
Signature · 1 line
2.32.0
Acked-by on v1 1/1
#1 lore raw
Quoted 35 lines · Fabio M. De Francesco

Remove defined but not used const variables. Issues detected by GCC running with -Wunused-const-variable option enabled.

---
  drivers/staging/r8188eu/os_dep/ioctl_linux.c | 21 --------------------
  1 file changed, 21 deletions(-)
drivers/staging/r8188eu/os_dep/ioctl_linux.c +0 -11
index 38ee41f9d2ba..d9fdd83218dc 100644
@@ -84,11 +84,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;
@@ -6666,19 +6661,3 @@ struct iw_handler_def rtw_handlers_def = {
  	.num_private_args = sizeof(rtw_private_args) / sizeof(struct iw_priv_args),
  	.get_wireless_stats = rtw_get_wireless_stats,
  };
-
-/*  copy from net/wireless/wext.c start */
-/* ---------------------------------------------------------------- */
-/*
- * Calculate size of private arguments
- */

drivers/staging/r8188eu/os_dep/ioctl_linux.c struct iw_handler_def rtw_handlers_def = { · line 6684

Quoted 10 lines
drivers/staging/r8188eu/os_dep/ioctl_linux.c +0 -10
-static const char iw_priv_type_size[] = {
-	0,			      /* IW_PRIV_TYPE_NONE */
-	1,			      /* IW_PRIV_TYPE_BYTE */
-	1,			      /* IW_PRIV_TYPE_CHAR */
-	0,			      /* Not defined */
-	sizeof(__u32),		  /* IW_PRIV_TYPE_INT */
-	sizeof(struct iw_freq),	 /* IW_PRIV_TYPE_FLOAT */
-	sizeof(struct sockaddr),	/* IW_PRIV_TYPE_ADDR */
-	0,			      /* Not defined */
-};

Looks good to me, thanks.

Michael

Acked-by on v1 1/1
#2 lore raw
In reply to Fabio M. De Francesco
Quoted 46 lines · Fabio M. De Francesco

Remove defined but not used const variables. Issues detected by GCC running with -Wunused-const-variable option enabled.

---
 drivers/staging/r8188eu/os_dep/ioctl_linux.c | 21 --------------------
 1 file changed, 21 deletions(-)
drivers/staging/r8188eu/os_dep/ioctl_linux.c +0 -22
index 38ee41f9d2ba..d9fdd83218dc 100644
@@ -84,11 +84,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;
@@ -6666,19 +6661,3 @@ struct iw_handler_def rtw_handlers_def = {
        .num_private_args = sizeof(rtw_private_args) / sizeof(struct iw_priv_args),
        .get_wireless_stats = rtw_get_wireless_stats,
 };
-
-/*  copy from net/wireless/wext.c start */
-/* ---------------------------------------------------------------- */
-/*
- * Calculate size of private arguments
- */
-static const char iw_priv_type_size[] = {
-       0,                            /* IW_PRIV_TYPE_NONE */
-       1,                            /* IW_PRIV_TYPE_BYTE */
-       1,                            /* IW_PRIV_TYPE_CHAR */
-       0,                            /* Not defined */
-       sizeof(__u32),            /* IW_PRIV_TYPE_INT */
-       sizeof(struct iw_freq),  /* IW_PRIV_TYPE_FLOAT */
-       sizeof(struct sockaddr),        /* IW_PRIV_TYPE_ADDR */
-       0,                            /* Not defined */
-};
--
Quoted 2 lines

2.32.0

Thanks Fabio.

Regards,
Phil