Skip to content

Commit

Permalink
beceem: make local functions static
Browse files Browse the repository at this point in the history
Use namespace tool from kernel scripts to identify dead code and
functions that should be static.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
  • Loading branch information
Stephen Hemminger committed Nov 1, 2010
1 parent 4540055 commit 9dd47ee
Show file tree
Hide file tree
Showing 16 changed files with 178 additions and 366 deletions.
5 changes: 3 additions & 2 deletions drivers/staging/bcm/CmHost.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ typedef enum _E_CLASSIFIER_ACTION
eDeleteClassifier
}E_CLASSIFIER_ACTION;

static ULONG GetNextTargetBufferLocation(PMINI_ADAPTER Adapter,B_UINT16 tid);

/************************************************************
* Function - SearchSfid
Expand Down Expand Up @@ -108,7 +109,7 @@ static int SearchFreeClsid(PMINI_ADAPTER Adapter /**Adapter Context*/
return MAX_CLASSIFIERS+1;
}

VOID deleteSFBySfid(PMINI_ADAPTER Adapter, UINT uiSearchRuleIndex)
static VOID deleteSFBySfid(PMINI_ADAPTER Adapter, UINT uiSearchRuleIndex)
{
//deleting all the packet held in the SF
flush_queue(Adapter,uiSearchRuleIndex);
Expand Down Expand Up @@ -1923,7 +1924,7 @@ ULONG SetUpTargetDsxBuffers(PMINI_ADAPTER Adapter)
return 1;
}

ULONG GetNextTargetBufferLocation(PMINI_ADAPTER Adapter,B_UINT16 tid)
static ULONG GetNextTargetBufferLocation(PMINI_ADAPTER Adapter,B_UINT16 tid)
{
ULONG ulTargetDSXBufferAddress;
ULONG ulTargetDsxBufferIndexToUse,ulMaxTry;
Expand Down
3 changes: 0 additions & 3 deletions drivers/staging/bcm/CmHost.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,13 @@ typedef struct stLocalSFChangeIndicationAlt{

ULONG StoreCmControlResponseMessage(PMINI_ADAPTER Adapter,PVOID pvBuffer,UINT *puBufferLength);

ULONG GetNextTargetBufferLocation(PMINI_ADAPTER Adapter,B_UINT16 tid);

INT AllocAdapterDsxBuffer(PMINI_ADAPTER Adapter);

INT FreeAdapterDsxBuffer(PMINI_ADAPTER Adapter);
ULONG SetUpTargetDsxBuffers(PMINI_ADAPTER Adapter);

BOOLEAN CmControlResponseMessage(PMINI_ADAPTER Adapter,PVOID pvBuffer);

VOID deleteSFBySfid(PMINI_ADAPTER Adapter, UINT uiSearchRuleIndex);

#pragma pack (pop)

Expand Down
3 changes: 1 addition & 2 deletions drivers/staging/bcm/HandleControlPacket.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ When a control packet is received, analyze the
Enqueue the control packet for Application.
@return None
*/
VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, /**<Pointer to the Adapter structure*/
struct sk_buff *skb) /**<Pointer to the socket buffer*/
static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb)
{
PPER_TARANG_DATA pTarang = NULL;
BOOLEAN HighPriorityMessage = FALSE;
Expand Down
10 changes: 7 additions & 3 deletions drivers/staging/bcm/IPv6Protocol.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#include "headers.h"

static BOOLEAN MatchSrcIpv6Address(S_CLASSIFIER_RULE *pstClassifierRule,IPV6Header *pstIpv6Header);
static BOOLEAN MatchDestIpv6Address(S_CLASSIFIER_RULE *pstClassifierRule,IPV6Header *pstIpv6Header);
static VOID DumpIpv6Header(IPV6Header *pstIpv6Header);

static UCHAR * GetNextIPV6ChainedHeader(UCHAR **ppucPayload,UCHAR *pucNextHeader,BOOLEAN *bParseDone,USHORT *pusPayloadLength)
{
UCHAR *pucRetHeaderPtr = NULL;
Expand Down Expand Up @@ -257,7 +261,7 @@ USHORT IpVersion6(PMINI_ADAPTER Adapter, /**< Pointer to the driver control stru
}


BOOLEAN MatchSrcIpv6Address(S_CLASSIFIER_RULE *pstClassifierRule,IPV6Header *pstIpv6Header)
static BOOLEAN MatchSrcIpv6Address(S_CLASSIFIER_RULE *pstClassifierRule,IPV6Header *pstIpv6Header)
{
UINT uiLoopIndex=0;
UINT uiIpv6AddIndex=0;
Expand Down Expand Up @@ -310,7 +314,7 @@ BOOLEAN MatchSrcIpv6Address(S_CLASSIFIER_RULE *pstClassifierRule,IPV6Header *pst
return FALSE;
}

BOOLEAN MatchDestIpv6Address(S_CLASSIFIER_RULE *pstClassifierRule,IPV6Header *pstIpv6Header)
static BOOLEAN MatchDestIpv6Address(S_CLASSIFIER_RULE *pstClassifierRule,IPV6Header *pstIpv6Header)
{
UINT uiLoopIndex=0;
UINT uiIpv6AddIndex=0;
Expand Down Expand Up @@ -376,7 +380,7 @@ VOID DumpIpv6Address(ULONG *puIpv6Address)

}

VOID DumpIpv6Header(IPV6Header *pstIpv6Header)
static VOID DumpIpv6Header(IPV6Header *pstIpv6Header)
{
UCHAR ucVersion;
UCHAR ucPrio ;
Expand Down
3 changes: 0 additions & 3 deletions drivers/staging/bcm/IPv6ProtocolHdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,12 @@ typedef enum _E_IPADDR_CONTEXT


//Function Prototypes
BOOLEAN MatchSrcIpv6Address(S_CLASSIFIER_RULE *pstClassifierRule,IPV6Header *pstIpv6Header);
BOOLEAN MatchDestIpv6Address(S_CLASSIFIER_RULE *pstClassifierRule,IPV6Header *pstIpv6Header);

USHORT IpVersion6(PMINI_ADAPTER Adapter, /**< Pointer to the driver control structure */
PVOID pcIpHeader, /**<Pointer to the IP Hdr of the packet*/
S_CLASSIFIER_RULE *pstClassifierRule );

VOID DumpIpv6Address(ULONG *puIpv6Address);
VOID DumpIpv6Header(IPV6Header *pstIpv6Header);

extern BOOLEAN MatchSrcPort(S_CLASSIFIER_RULE *pstClassifierRule,USHORT ushSrcPort);
extern BOOLEAN MatchDestPort(S_CLASSIFIER_RULE *pstClassifierRule,USHORT ushSrcPort);
Expand Down
12 changes: 1 addition & 11 deletions drivers/staging/bcm/InterfaceIdleMode.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,7 @@ int InterfaceIdleModeRespond(PMINI_ADAPTER Adapter, unsigned int* puiBuffer)
return status;
}


VOID InterfaceWriteIdleModeWakePattern(PMINI_ADAPTER Adapter)
{
/* BeceemWriteMemoryUshort(Adapter, Host2CPU_Mailbox_Low, 0x1d1e);
BeceemWriteMemoryUshort(Adapter, Host2CPU_Mailbox_Low, 0x1d1e);
BeceemWriteMemoryUshort(Adapter, Host2CPU_Mailbox_Upp, 0xd0ea);
BeceemWriteMemoryUshort(Adapter, Host2CPU_Mailbox_Upp, 0xd0ea);*/
return;
}

int InterfaceAbortIdlemode(PMINI_ADAPTER Adapter, unsigned int Pattern)
static int InterfaceAbortIdlemode(PMINI_ADAPTER Adapter, unsigned int Pattern)
{
int status = STATUS_SUCCESS;
unsigned int value;
Expand Down
2 changes: 0 additions & 2 deletions drivers/staging/bcm/InterfaceIdleMode.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ INT InterfaceIdleModeRespond(PMINI_ADAPTER Adapter, unsigned int *puiBuffer);

VOID InterfaceWriteIdleModeWakePattern(PMINI_ADAPTER Adapter);

INT InterfaceAbortIdlemode(PMINI_ADAPTER Adapter, unsigned int Pattern);

INT InterfaceWakeUp(PMINI_ADAPTER Adapter);

VOID InterfaceHandleShutdownModeWakeup(PMINI_ADAPTER Adapter);
Expand Down
8 changes: 5 additions & 3 deletions drivers/staging/bcm/InterfaceInit.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ static struct usb_device_id InterfaceUsbtable[] = {
};
MODULE_DEVICE_TABLE(usb, InterfaceUsbtable);

VOID InterfaceAdapterFree(PS_INTERFACE_ADAPTER psIntfAdapter)
static INT InterfaceAdapterInit(PS_INTERFACE_ADAPTER Adapter);

static VOID InterfaceAdapterFree(PS_INTERFACE_ADAPTER psIntfAdapter)
{
INT i = 0;
// Wake up the wait_queue...
Expand Down Expand Up @@ -58,7 +60,7 @@ VOID InterfaceAdapterFree(PS_INTERFACE_ADAPTER psIntfAdapter)
AdapterFree(psIntfAdapter->psAdapter);
}

VOID ConfigureEndPointTypesThroughEEPROM(PMINI_ADAPTER Adapter)
static VOID ConfigureEndPointTypesThroughEEPROM(PMINI_ADAPTER Adapter)
{
ULONG ulReg = 0;

Expand Down Expand Up @@ -441,7 +443,7 @@ static inline int bcm_usb_endpoint_is_isoc_out(const struct usb_endpoint_descrip
return (bcm_usb_endpoint_xfer_isoc(epd) && bcm_usb_endpoint_dir_out(epd));
}

INT InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter)
static INT InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter)
{
struct usb_host_interface *iface_desc;
struct usb_endpoint_descriptor *endpoint;
Expand Down
4 changes: 0 additions & 4 deletions drivers/staging/bcm/InterfaceInit.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ INT InterfaceInitialize(void);

INT InterfaceExit(void);

INT InterfaceAdapterInit(PS_INTERFACE_ADAPTER Adapter);

INT usbbcm_worker_thread(PS_INTERFACE_ADAPTER psIntfAdapter);

VOID InterfaceAdapterFree(PS_INTERFACE_ADAPTER psIntfAdapter);

#endif

36 changes: 0 additions & 36 deletions drivers/staging/bcm/InterfaceIsr.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,39 +167,3 @@ INT StartInterruptUrb(PS_INTERFACE_ADAPTER psIntfAdapter)
return status;
}

/*
Function: InterfaceEnableInterrupt
Description: This is the hardware specific Function for configuring
and enabling the interrupts on the device.
Input parameters: IN PMINI_ADAPTER Adapter - Miniport Adapter Context
Return: BCM_STATUS_SUCCESS - If configuring the interrupts was successful.
Other - If an error occured.
*/

void InterfaceEnableInterrupt(PMINI_ADAPTER Adapter)
{

}

/*
Function: InterfaceDisableInterrupt
Description: This is the hardware specific Function for disabling the interrupts on the device.
Input parameters: IN PMINI_ADAPTER Adapter - Miniport Adapter Context
Return: BCM_STATUS_SUCCESS - If disabling the interrupts was successful.
Other - If an error occured.
*/

void InterfaceDisableInterrupt(PMINI_ADAPTER Adapter)
{

}


52 changes: 14 additions & 38 deletions drivers/staging/bcm/Misc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#include "headers.h"

static int BcmFileDownload(PMINI_ADAPTER Adapter, const char *path,
unsigned int loc);
static VOID doPowerAutoCorrection(PMINI_ADAPTER psAdapter);
static void HandleShutDownModeRequest(PMINI_ADAPTER Adapter,PUCHAR pucBuffer);
static int bcm_parse_target_params(PMINI_ADAPTER Adapter);
static void beceem_protocol_reset (PMINI_ADAPTER Adapter);

static VOID default_wimax_protocol_initialize(PMINI_ADAPTER Adapter)
{

Expand Down Expand Up @@ -175,7 +182,7 @@ static int create_worker_threads(PMINI_ADAPTER psAdapter)
return 0;
}

static struct file *open_firmware_file(PMINI_ADAPTER Adapter, char *path)
static struct file *open_firmware_file(PMINI_ADAPTER Adapter, const char *path)
{
struct file *flp=NULL;
mm_segment_t oldfs;
Expand All @@ -197,8 +204,8 @@ static struct file *open_firmware_file(PMINI_ADAPTER Adapter, char *path)
}


int BcmFileDownload(PMINI_ADAPTER Adapter,/**< Logical Adapter */
char *path, /**< path to image file */
static int BcmFileDownload(PMINI_ADAPTER Adapter,/**< Logical Adapter */
const char *path, /**< path to image file */
unsigned int loc /**< Download Address on the chip*/
)
{
Expand Down Expand Up @@ -478,18 +485,6 @@ static VOID SendStatisticsPointerRequest(PMINI_ADAPTER Adapter,
#endif


void SendLinkDown(PMINI_ADAPTER Adapter)
{
LINK_REQUEST stLinkDownRequest;
memset(&stLinkDownRequest, 0, sizeof(LINK_REQUEST));
stLinkDownRequest.Leader.Status=LINK_UP_CONTROL_REQ;
stLinkDownRequest.Leader.PLength=sizeof(ULONG);//minimum 4 bytes
stLinkDownRequest.szData[0]=LINK_DOWN_REQ_PAYLOAD;
Adapter->bLinkDownRequested = TRUE;

CopyBufferToControlPacket(Adapter,&stLinkDownRequest);
}

/******************************************************************
* Function - LinkMessage()
*
Expand Down Expand Up @@ -1229,7 +1224,7 @@ int InitCardAndDownloadFirmware(PMINI_ADAPTER ps_adapter)
}


int bcm_parse_target_params(PMINI_ADAPTER Adapter)
static int bcm_parse_target_params(PMINI_ADAPTER Adapter)
{
struct file *flp=NULL;
mm_segment_t oldfs={0};
Expand Down Expand Up @@ -1357,7 +1352,7 @@ void beceem_parse_target_struct(PMINI_ADAPTER Adapter)

}

VOID doPowerAutoCorrection(PMINI_ADAPTER psAdapter)
static VOID doPowerAutoCorrection(PMINI_ADAPTER psAdapter)
{
UINT reporting_mode;

Expand Down Expand Up @@ -1496,26 +1491,7 @@ int rdmalt (PMINI_ADAPTER Adapter, UINT uiAddress, PUINT pucBuff, size_t size)
return uiRetVal;
}

int rdmWithLock(PMINI_ADAPTER Adapter, UINT uiAddress, PCHAR pucBuff, size_t sSize)
{

INT status = STATUS_SUCCESS ;
down(&Adapter->rdmwrmsync);

if((Adapter->IdleMode == TRUE) ||
(Adapter->bShutStatus ==TRUE) ||
(Adapter->bPreparingForLowPowerMode ==TRUE))
{
status = -EACCES;
goto exit;
}

status = rdm(Adapter, uiAddress, pucBuff, sSize);

exit:
up(&Adapter->rdmwrmsync);
return status ;
}
int wrmWithLock(PMINI_ADAPTER Adapter, UINT uiAddress, PCHAR pucBuff, size_t sSize)
{
INT status = STATUS_SUCCESS ;
Expand Down Expand Up @@ -1707,7 +1683,7 @@ static VOID SendShutModeResponse(PMINI_ADAPTER Adapter)
}


void HandleShutDownModeRequest(PMINI_ADAPTER Adapter,PUCHAR pucBuffer)
static void HandleShutDownModeRequest(PMINI_ADAPTER Adapter,PUCHAR pucBuffer)
{
B_UINT32 uiResetValue = 0;

Expand Down Expand Up @@ -1891,7 +1867,7 @@ void flush_queue(PMINI_ADAPTER Adapter, UINT iQIndex)

}

void beceem_protocol_reset (PMINI_ADAPTER Adapter)
static void beceem_protocol_reset (PMINI_ADAPTER Adapter)
{
int i;

Expand Down
Loading

0 comments on commit 9dd47ee

Please sign in to comment.