Skip to content

Commit

Permalink
Staging: bcm: Remove typedef for _FLASH2X_READWRITE and call directly.
Browse files Browse the repository at this point in the history
This patch removes typedef for _FLASH2X_READWRITE,
and changes the name of the struct to
bcm_flash2x_readwrite. In addition, any calls to
typedefs FLASH2X_READWRITE, or *PFLASH2X_READWRITE
are changed to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Kevin McKinney authored and Greg Kroah-Hartman committed Nov 27, 2012
1 parent 3712af0 commit b4a29e1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions drivers/staging/bcm/Bcmchar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
}

case IOCTL_BCM_FLASH2X_SECTION_READ: {
FLASH2X_READWRITE sFlash2xRead = {0};
struct bcm_flash2x_readwrite sFlash2xRead = {0};
PUCHAR pReadBuff = NULL ;
UINT NOB = 0;
UINT BuffSize = 0;
Expand All @@ -1422,7 +1422,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
return -EFAULT;

/* Reading FLASH 2.x READ structure */
if (copy_from_user(&sFlash2xRead, IoBuffer.InputBuffer, sizeof(FLASH2X_READWRITE)))
if (copy_from_user(&sFlash2xRead, IoBuffer.InputBuffer, sizeof(struct bcm_flash2x_readwrite)))
return -EFAULT;

BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "\nsFlash2xRead.Section :%x", sFlash2xRead.Section);
Expand Down Expand Up @@ -1495,7 +1495,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
break;

case IOCTL_BCM_FLASH2X_SECTION_WRITE: {
FLASH2X_READWRITE sFlash2xWrite = {0};
struct bcm_flash2x_readwrite sFlash2xWrite = {0};
PUCHAR pWriteBuff;
void __user *InputAddr;
UINT NOB = 0;
Expand All @@ -1517,7 +1517,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
return -EFAULT;

/* Reading FLASH 2.x READ structure */
if (copy_from_user(&sFlash2xWrite, IoBuffer.InputBuffer, sizeof(FLASH2X_READWRITE)))
if (copy_from_user(&sFlash2xWrite, IoBuffer.InputBuffer, sizeof(struct bcm_flash2x_readwrite)))
return -EFAULT;

BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "\nsFlash2xRead.Section :%x", sFlash2xWrite.Section);
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/bcm/Ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ typedef enum _FLASH2X_SECTION_VAL {
/*
* Structure used for READ/WRITE Flash Map2.x
*/
typedef struct _FLASH2X_READWRITE {
struct bcm_flash2x_readwrite {
FLASH2X_SECTION_VAL Section; /* which section has to be read/written */
u32 offset; /* Offset within Section. */
u32 numOfBytes; /* NOB from the offset */
u32 bVerify;
void __user *pDataBuff; /* Buffer for reading/writing */
} FLASH2X_READWRITE, *PFLASH2X_READWRITE;
};

/*
* This structure is used for coping one section to other.
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/bcm/Prototypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ INT BcmDeAllocFlashCSStructure(struct bcm_mini_adapter *psAdapter);
INT BcmCopyISO(struct bcm_mini_adapter *Adapter, struct bcm_flash2x_copy_section sCopySectStrut);
INT BcmFlash2xCorruptSig(struct bcm_mini_adapter *Adapter, FLASH2X_SECTION_VAL eFlash2xSectionVal);
INT BcmFlash2xWriteSig(struct bcm_mini_adapter *Adapter, FLASH2X_SECTION_VAL eFlashSectionVal);
INT validateFlash2xReadWrite(struct bcm_mini_adapter *Adapter, PFLASH2X_READWRITE psFlash2xReadWrite);
INT validateFlash2xReadWrite(struct bcm_mini_adapter *Adapter, struct bcm_flash2x_readwrite *psFlash2xReadWrite);
INT IsFlash2x(struct bcm_mini_adapter *Adapter);
INT BcmCopySection(struct bcm_mini_adapter *Adapter,
FLASH2X_SECTION_VAL SrcSection,
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/bcm/nvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3901,7 +3901,7 @@ int BcmFlash2xWriteSig(struct bcm_mini_adapter *Adapter, FLASH2X_SECTION_VAL eFl
* Return values:-Return TRUE is request is valid else FALSE.
*/

int validateFlash2xReadWrite(struct bcm_mini_adapter *Adapter, PFLASH2X_READWRITE psFlash2xReadWrite)
int validateFlash2xReadWrite(struct bcm_mini_adapter *Adapter, struct bcm_flash2x_readwrite *psFlash2xReadWrite)
{
unsigned int uiNumOfBytes = 0;
unsigned int uiSectStartOffset = 0;
Expand Down

0 comments on commit b4a29e1

Please sign in to comment.