Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 44a17eff authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman
Browse files

staging/bcm: add sparse annotations



This marks up the code where sparse complains in most cases.
Most of the changes are in the ioctl handling code, which
gets __user annotations, finding one unchecked user access.

The rest is mostly about marking functions static when they
are only used in one file.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9f1c75ac
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -652,7 +652,7 @@ typedef struct _ETH_HEADER_STRUC ETH_HEADER_STRUC, *PETH_HEADER_STRUC;

typedef struct FirmwareInfo
{
	PVOID		pvMappedFirmwareAddress;
	void __user *	pvMappedFirmwareAddress;
	ULONG		u32FirmwareLength;
	ULONG		u32StartingAddress;
}__attribute__((packed)) FIRMWARE_INFO, *PFIRMWARE_INFO;
+71 −77

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ static struct net_device_stats *bcm_get_stats(struct net_device *dev)
Register other driver entry points with the kernel
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
struct net_device_ops bcmNetDevOps = {
static struct net_device_ops bcmNetDevOps = {
    .ndo_open		= bcm_open,
    .ndo_stop 		= bcm_close,
    .ndo_get_stats 	= bcm_get_stats,
+4 −4
Original line number Diff line number Diff line
@@ -1014,7 +1014,7 @@ static VOID CopyToAdapter( register PMINI_ADAPTER Adapter, /**<Pointer to the A
*
* Returns	  - None
*************************************************************************/
VOID DumpCmControlPacket(PVOID pvBuffer)
static VOID DumpCmControlPacket(PVOID pvBuffer)
{
	UINT 					uiLoopIndex;
	UINT                    nIndex;
@@ -2362,7 +2362,7 @@ BOOLEAN CmControlResponseMessage(PMINI_ADAPTER Adapter, /**<Pointer to the Adap
	return TRUE;
}

int get_dsx_sf_data_to_application(PMINI_ADAPTER Adapter, UINT uiSFId, PUCHAR user_buffer)
int get_dsx_sf_data_to_application(PMINI_ADAPTER Adapter, UINT uiSFId, void __user *user_buffer)
{
	int status = 0;
	struct _packet_info *psSfInfo=NULL;
@@ -2375,8 +2375,8 @@ int get_dsx_sf_data_to_application(PMINI_ADAPTER Adapter, UINT uiSFId, PUCHAR us
	}
	BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "status =%d",status);
	psSfInfo=&Adapter->PackInfo[status];
	if(psSfInfo->pstSFIndication && copy_to_user((PCHAR)user_buffer,
		(PCHAR)psSfInfo->pstSFIndication, sizeof(stLocalSFAddIndicationAlt)))
	if(psSfInfo->pstSFIndication && copy_to_user(user_buffer,
		psSfInfo->pstSFIndication, sizeof(stLocalSFAddIndicationAlt)))
	{
		BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "copy to user failed SFID %d, present in queue !!!", uiSFId );
		status = -EFAULT;
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
static UINT current_debug_level=BCM_SCREAM;

int bcm_print_buffer( UINT debug_level, const char *function_name,
				  char *file_name, int line_number, unsigned char *buffer, int bufferlen, unsigned int base)
				  char *file_name, int line_number, unsigned char *buffer, int bufferlen, enum _BASE_TYPE base)
{
	static const char * const buff_dump_base[] = {
		"DEC", "HEX", "OCT", "BIN"
Loading