[OPW,kernel] staging: rtl8723au: Remove useless static functions
diff mbox

Message ID 1414691955-4198-1-git-send-email-roberta.dobrescu@gmail.com
State New, archived
Headers show

Commit Message

Roberta Dobrescu Oct. 30, 2014, 5:59 p.m. UTC
This patch removes the static functions bthci_CmdSetEventFilter,
bthci_CmdReadRSSI and bthci_CmdHostNumberOfCompletedPackets, since their
body only consists of 'return HCI_STATUS_SUCCESS'.

Additionally, it removes the associated case labels and identifiers, since
these aren't used for anything else.

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
---
 .../staging/rtl8723au/hal/rtl8723a_bt-coexist.c    | 34 ----------------------
 .../rtl8723au/include/rtl8723a_bt-coexist.h        |  3 --
 2 files changed, 37 deletions(-)

Comments

Arnd Bergmann Oct. 30, 2014, 7:11 p.m. UTC | #1
On Thursday 30 October 2014 19:59:15 Roberta Dobrescu wrote:
> -       case HCI_SET_EVENT_FILTER:
> -               RTPRINT(FIOCTL, IOCTL_BT_HCICMD, ("HCI_SET_EVENT_FILTER\n"));
> -               status = bthci_CmdSetEventFilter(padapter, pHciCmd);
> -               break;
>         case HCI_WRITE_CONNECTION_ACCEPT_TIMEOUT:
>                 RTPRINT(FIOCTL, IOCTL_BT_HCICMD, ("HCI_WRITE_CONNECTION_ACCEPT_TIMEOUT\n"));
>                 status = bthci_CmdWriteConnectionAcceptTimeout(padapter, pHciCmd);
> 

This changes behavior of the driver: if someone calls HCI_SET_EVENT_FILTER
or one of the other lines you change, the driver now prints a warningn and
returns HCI_STATUS_UNKNOW_HCI_CMD, instead of silently returning
HCI_STATUS_SUCCESS. I don't know whether that is a good or bad change,
but if it is intentional, you should describe why you did it in the
changelog.

	Arnd
Roberta Dobrescu Oct. 30, 2014, 9:13 p.m. UTC | #2
On 30.10.2014 21:11, Arnd Bergmann wrote:
> On Thursday 30 October 2014 19:59:15 Roberta Dobrescu wrote:
>> -       case HCI_SET_EVENT_FILTER:
>> -               RTPRINT(FIOCTL, IOCTL_BT_HCICMD, ("HCI_SET_EVENT_FILTER\n"));
>> -               status = bthci_CmdSetEventFilter(padapter, pHciCmd);
>> -               break;
>>          case HCI_WRITE_CONNECTION_ACCEPT_TIMEOUT:
>>                  RTPRINT(FIOCTL, IOCTL_BT_HCICMD, ("HCI_WRITE_CONNECTION_ACCEPT_TIMEOUT\n"));
>>                  status = bthci_CmdWriteConnectionAcceptTimeout(padapter, pHciCmd);
>>
>
> This changes behavior of the driver: if someone calls HCI_SET_EVENT_FILTER
> or one of the other lines you change, the driver now prints a warningn and
> returns HCI_STATUS_UNKNOW_HCI_CMD, instead of silently returning
> HCI_STATUS_SUCCESS. I don't know whether that is a good or bad change,
> but if it is intentional, you should describe why you did it in the
> changelog.

That's what I did first, just return HCI_STATUS_SUCCESS, but then I
thought that status is set to HCI_STATUS_SUCCESS before the switch and
removing the case labels won't damage. I don't know how I missed the
default rule. It wasn't my intention to change the behaviour of the
driver, first of all because this isn't the purpose of this patch.

Thanks a lot for reviewing this. I'll send a revised patch just
removing the function calls and I'll continue check this driver
for further improvements.

Roberta

Patch
diff mbox

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
index 5de806e..9975cfe 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
@@ -1759,16 +1759,6 @@  static enum hci_status bthci_CmdReadConnectionAcceptTimeout(struct rtw_adapter *
 	return status;
 }
 
-/* 7.3.3 */
-static enum hci_status
-bthci_CmdSetEventFilter(
-	struct rtw_adapter *padapter,
-	struct packet_irp_hcicmd_data *pHciCmd
-	)
-{
-	return HCI_STATUS_SUCCESS;
-}
-
 /* 7.3.14 */
 static enum hci_status
 bthci_CmdWriteConnectionAcceptTimeout(
@@ -2980,11 +2970,6 @@  bthci_CmdReadLinkQuality(
 	return status;
 }
 
-static enum hci_status bthci_CmdReadRSSI(struct rtw_adapter *padapter)
-{
-	return HCI_STATUS_SUCCESS;
-}
-
 static enum hci_status
 bthci_CmdCreateLogicalLink(
 	struct rtw_adapter *padapter,
@@ -4133,13 +4118,6 @@  bthci_CmdHostBufferSize(struct rtw_adapter *padapter,
 }
 
 static enum hci_status
-bthci_CmdHostNumberOfCompletedPackets(struct rtw_adapter *padapter,
-				      struct packet_irp_hcicmd_data *pHciCmd)
-{
-	return HCI_STATUS_SUCCESS;
-}
-
-static enum hci_status
 bthci_UnknownCMD(struct rtw_adapter *padapter, struct packet_irp_hcicmd_data *pHciCmd)
 {
 	enum hci_status status = HCI_STATUS_UNKNOW_HCI_CMD;
@@ -4210,10 +4188,6 @@  bthci_HandleOGFSetEventMaskCMD(struct rtw_adapter *padapter,
 		RTPRINT(FIOCTL, IOCTL_BT_HCICMD, ("HCI_READ_CONNECTION_ACCEPT_TIMEOUT\n"));
 		status = bthci_CmdReadConnectionAcceptTimeout(padapter);
 		break;
-	case HCI_SET_EVENT_FILTER:
-		RTPRINT(FIOCTL, IOCTL_BT_HCICMD, ("HCI_SET_EVENT_FILTER\n"));
-		status = bthci_CmdSetEventFilter(padapter, pHciCmd);
-		break;
 	case HCI_WRITE_CONNECTION_ACCEPT_TIMEOUT:
 		RTPRINT(FIOCTL, IOCTL_BT_HCICMD, ("HCI_WRITE_CONNECTION_ACCEPT_TIMEOUT\n"));
 		status = bthci_CmdWriteConnectionAcceptTimeout(padapter, pHciCmd);
@@ -4226,10 +4200,6 @@  bthci_HandleOGFSetEventMaskCMD(struct rtw_adapter *padapter,
 		RTPRINT(FIOCTL, IOCTL_BT_HCICMD, ("HCI_WRITE_PAGE_TIMEOUT\n"));
 		status = bthci_CmdWritePageTimeout(padapter, pHciCmd);
 		break;
-	case HCI_HOST_NUMBER_OF_COMPLETED_PACKETS:
-		RTPRINT(FIOCTL, IOCTL_BT_HCICMD, ("HCI_HOST_NUMBER_OF_COMPLETED_PACKETS\n"));
-		status = bthci_CmdHostNumberOfCompletedPackets(padapter, pHciCmd);
-		break;
 	case HCI_READ_LINK_SUPERVISION_TIMEOUT:
 		RTPRINT(FIOCTL, IOCTL_BT_HCICMD, ("HCI_READ_LINK_SUPERVISION_TIMEOUT\n"));
 		status = bthci_CmdReadLinkSupervisionTimeout(padapter, pHciCmd);
@@ -4314,10 +4284,6 @@  bthci_HandleOGFStatusParameters(struct rtw_adapter *padapter,
 		RTPRINT(FIOCTL, IOCTL_BT_HCICMD, ("HCI_READ_LINK_QUALITY\n"));
 		status = bthci_CmdReadLinkQuality(padapter, pHciCmd);
 		break;
-	case HCI_READ_RSSI:
-		RTPRINT(FIOCTL, IOCTL_BT_HCICMD, ("HCI_READ_RSSI\n"));
-		status = bthci_CmdReadRSSI(padapter);
-		break;
 	case HCI_READ_LOCAL_AMP_INFO:
 		RTPRINT(FIOCTL, IOCTL_BT_HCICMD, ("HCI_READ_LOCAL_AMP_INFO\n"));
 		status = bthci_CmdReadLocalAMPInfo(padapter);
diff --git a/drivers/staging/rtl8723au/include/rtl8723a_bt-coexist.h b/drivers/staging/rtl8723au/include/rtl8723a_bt-coexist.h
index 0506965..d6ee7cb 100644
--- a/drivers/staging/rtl8723au/include/rtl8723a_bt-coexist.h
+++ b/drivers/staging/rtl8723au/include/rtl8723a_bt-coexist.h
@@ -265,7 +265,6 @@  enum hold_mode_command {
 enum set_event_mask_command {
 	HCI_SET_EVENT_MASK				= 0x0001,
 	HCI_RESET					= 0x0003,
-	HCI_SET_EVENT_FILTER				= 0x0005,
 	HCI_FLUSH					= 0x0008,
 	HCI_READ_PIN_TYPE				= 0x0009,
 	HCI_WRITE_PIN_TYPE				= 0x000a,
@@ -301,7 +300,6 @@  enum set_event_mask_command {
 	HCI_WRITE_SYNCHRONOUS_FLOW_CONTROL_ENABLE	= 0x002f,
 	HCI_SET_CONTROLLER_TO_HOST_FLOW_CONTROL		= 0x0031,
 	HCI_HOST_BUFFER_SIZE				= 0x0033,
-	HCI_HOST_NUMBER_OF_COMPLETED_PACKETS		= 0x0035,
 	HCI_READ_LINK_SUPERVISION_TIMEOUT		= 0x0036,
 	HCI_WRITE_LINK_SUPERVISION_TIMEOUT		= 0x0037,
 	HCI_READ_NUMBER_OF_SUPPORTED_IAC		= 0x0038,
@@ -361,7 +359,6 @@  enum status_params {
 	HCI_READ_FAILED_CONTACT_COUNTER			= 0x0001,
 	HCI_RESET_FAILED_CONTACT_COUNTER		= 0x0002,
 	HCI_READ_LINK_QUALITY				= 0x0003,
-	HCI_READ_RSSI					= 0x0005,
 	HCI_READ_AFH_CHANNEL_MAP			= 0x0006,
 	HCI_READ_CLOCK					= 0x0007,
 	HCI_READ_ENCRYPTION_KEY_SIZE			= 0x0008,