Staging: bcm: Remove typedef for _FLASH_2X_CS_INFO and call directly.
authorKevin McKinney <klmckinney1@gmail.com>
Sat, 1 Dec 2012 06:15:55 +0000 (01:15 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jan 2013 18:45:51 +0000 (10:45 -0800)
This patch removes typedef for _FLASH_2X_CS_INFO, and
changes the name of the struct to bcm_flash2x_cs_info.
In addition, any calls to typedefs FLASH2X_CS_INFO, or
*PFLASH2X_CS_INFO are changed to call the struct
directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/bcm/Adapter.h
drivers/staging/bcm/Bcmchar.c
drivers/staging/bcm/nvm.c
drivers/staging/bcm/nvm.h

index 4231b67..d002aea 100644 (file)
@@ -366,7 +366,7 @@ struct bcm_mini_adapter {
        struct device           *pstCreatedClassDevice;
 
        /*      BOOLEAN                         InterfaceUpStatus; */
-       PFLASH2X_CS_INFO        psFlash2xCSInfo;
+       struct bcm_flash2x_cs_info *psFlash2xCSInfo;
        PFLASH_CS_INFO          psFlashCSInfo;
        struct bcm_flash2x_vendor_info *psFlash2xVendorInfo;
        UINT                    uiFlashBaseAdd; /* Flash start address */
index efad33e..300d60a 100644 (file)
@@ -1783,16 +1783,16 @@ cntrlEnd:
                }
 
                if (IsFlash2x(Adapter) == TRUE) {
-                       if (IoBuffer.OutputLength < sizeof(FLASH2X_CS_INFO))
+                       if (IoBuffer.OutputLength < sizeof(struct bcm_flash2x_cs_info))
                                return -EINVAL;
 
-                       if (copy_to_user(IoBuffer.OutputBuffer, Adapter->psFlash2xCSInfo, sizeof(FLASH2X_CS_INFO)))
+                       if (copy_to_user(IoBuffer.OutputBuffer, Adapter->psFlash2xCSInfo, sizeof(struct bcm_flash2x_cs_info)))
                                return -EFAULT;
                } else {
                        if (IoBuffer.OutputLength < sizeof(FLASH_CS_INFO))
                                return -EINVAL;
 
-                       if (copy_to_user(IoBuffer.OutputBuffer, Adapter->psFlashCSInfo, sizeof(FLASH_CS_INFO)))
+                       if (copy_to_user(IoBuffer.OutputBuffer, Adapter->psFlashCSInfo, sizeof(struct bcm_flash2x_cs_info)))
                                return -EFAULT;
                }
        }
index 468b316..2c3944c 100644 (file)
@@ -2234,7 +2234,7 @@ int BcmAllocFlashCSStructure(struct bcm_mini_adapter *psAdapter)
                return -ENOMEM;
        }
 
-       psAdapter->psFlash2xCSInfo = (PFLASH2X_CS_INFO)kzalloc(sizeof(FLASH2X_CS_INFO), GFP_KERNEL);
+       psAdapter->psFlash2xCSInfo = (struct bcm_flash2x_cs_info *)kzalloc(sizeof(struct bcm_flash2x_cs_info), GFP_KERNEL);
        if (!psAdapter->psFlash2xCSInfo) {
                BCM_DEBUG_PRINT(psAdapter, DBG_TYPE_PRINTK, 0, 0, "Can't Allocate memory for Flash 2.x");
                kfree(psAdapter->psFlashCSInfo);
@@ -2264,7 +2264,7 @@ int BcmDeAllocFlashCSStructure(struct bcm_mini_adapter *psAdapter)
        return STATUS_SUCCESS;
 }
 
-static int BcmDumpFlash2XCSStructure(PFLASH2X_CS_INFO psFlash2xCSInfo, struct bcm_mini_adapter *Adapter)
+static int BcmDumpFlash2XCSStructure(struct bcm_flash2x_cs_info *psFlash2xCSInfo, struct bcm_mini_adapter *Adapter)
 {
        unsigned int Index = 0;
 
@@ -2324,7 +2324,7 @@ static int BcmDumpFlash2XCSStructure(PFLASH2X_CS_INFO psFlash2xCSInfo, struct bc
        return STATUS_SUCCESS;
 }
 
-static int ConvertEndianOf2XCSStructure(PFLASH2X_CS_INFO psFlash2xCSInfo)
+static int ConvertEndianOf2XCSStructure(struct bcm_flash2x_cs_info *psFlash2xCSInfo)
 {
        unsigned int Index = 0;
 
@@ -2523,7 +2523,7 @@ static int BcmGetFlashCSInfo(struct bcm_mini_adapter *Adapter)
        Adapter->uiFlashBaseAdd = 0;
        Adapter->ulFlashCalStart = 0;
        memset(Adapter->psFlashCSInfo, 0 , sizeof(FLASH_CS_INFO));
-       memset(Adapter->psFlash2xCSInfo, 0 , sizeof(FLASH2X_CS_INFO));
+       memset(Adapter->psFlash2xCSInfo, 0 , sizeof(struct bcm_flash2x_cs_info));
 
        if (!Adapter->bDDRInitDone) {
                value = FLASH_CONTIGIOUS_START_ADDR_BEFORE_INIT;
@@ -2576,7 +2576,7 @@ static int BcmGetFlashCSInfo(struct bcm_mini_adapter *Adapter)
                Adapter->uiFlashBaseAdd = Adapter->psFlashCSInfo->FlashBaseAddr & 0xFCFFFFFF;
        } else {
                if (BcmFlash2xBulkRead(Adapter, (PUINT)Adapter->psFlash2xCSInfo, NO_SECTION_VAL,
-                                       Adapter->ulFlashControlSectionStart, sizeof(FLASH2X_CS_INFO))) {
+                                       Adapter->ulFlashControlSectionStart, sizeof(struct bcm_flash2x_cs_info))) {
                        BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Unable to read CS structure\n");
                        return STATUS_FAILURE;
                }
@@ -3101,7 +3101,7 @@ static int BcmDumpFlash2xSectionBitMap(struct bcm_flash2x_bitmap *psFlash2xBitMa
 
 int BcmGetFlash2xSectionalBitMap(struct bcm_mini_adapter *Adapter, struct bcm_flash2x_bitmap *psFlash2xBitMap)
 {
-       PFLASH2X_CS_INFO psFlash2xCSInfo = Adapter->psFlash2xCSInfo;
+       struct bcm_flash2x_cs_info *psFlash2xCSInfo = Adapter->psFlash2xCSInfo;
        enum bcm_flash2x_section_val uiHighestPriDSD = 0;
        enum bcm_flash2x_section_val uiHighestPriISO = 0;
        BOOLEAN SetActiveDSDDone = FALSE;
index 728a632..e64a620 100644 (file)
@@ -58,7 +58,7 @@ typedef struct _FLASH_CS_INFO {
 #define FLASH2X_TOTAL_SIZE     (64 * 1024 * 1024)
 #define DEFAULT_SECTOR_SIZE    (64 * 1024)
 
-typedef struct _FLASH_2X_CS_INFO {
+struct bcm_flash2x_cs_info {
        /* magic number as 0xBECE-F1A5 - F1A5 for "flas-h" */
        u32 MagicNumber;
        u32 FlashLayoutVersion;
@@ -118,7 +118,7 @@ typedef struct _FLASH_2X_CS_INFO {
         */
        u32 SectorAccessBitMap[FLASH2X_TOTAL_SIZE / (DEFAULT_SECTOR_SIZE * 16)];
        /* All expansions to the control data structure should add here */
-} FLASH2X_CS_INFO, *PFLASH2X_CS_INFO;
+};
 
 struct bcm_vendor_section_info {
        u32 OffsetFromZeroForSectionStart;