Staging: bcm: Remove typedef for _ISO_HEADER and call directly.
authorKevin McKinney <klmckinney1@gmail.com>
Sat, 1 Dec 2012 06:15:51 +0000 (01:15 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jan 2013 18:45:50 +0000 (10:45 -0800)
This patch removes typedef for _ISO_HEADER, and changes
the name of the struct to bcm_iso_header. In addition,
any calls to typedefs ISO_HEADER, or *PISO_HEADER 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/nvm.c
drivers/staging/bcm/nvm.h

index eab676fe53a6af44429fd164fadd6fa40039b113..3a77db34516770853c15b8c28b3d0648619910c6 100644 (file)
@@ -3355,7 +3355,7 @@ int BcmSetActiveSection(struct bcm_mini_adapter *Adapter, enum bcm_flash2x_secti
        int Status = STATUS_SUCCESS;
 
        /* DSD_HEADER sDSD = {0};
-        * ISO_HEADER sISO = {0};
+        * struct bcm_iso_header sISO = {0};
         */
        int HighestPriDSD = 0 ;
        int HighestPriISO = 0;
@@ -3391,7 +3391,7 @@ int BcmSetActiveSection(struct bcm_mini_adapter *Adapter, enum bcm_flash2x_secti
                                Status = BcmFlash2xBulkWrite(Adapter,
                                                        &SectImagePriority,
                                                        HighestPriISO,
-                                                       0 + FIELD_OFFSET_IN_HEADER(PISO_HEADER, ISOImagePriority),
+                                                       0 + FIELD_OFFSET_IN_HEADER(struct bcm_iso_header *, ISOImagePriority),
                                                        SIGNATURE_SIZE,
                                                        TRUE);
                                if (Status) {
@@ -3416,7 +3416,7 @@ int BcmSetActiveSection(struct bcm_mini_adapter *Adapter, enum bcm_flash2x_secti
                        Status = BcmFlash2xBulkWrite(Adapter,
                                                &SectImagePriority,
                                                eFlash2xSectVal,
-                                               0 + FIELD_OFFSET_IN_HEADER(PISO_HEADER, ISOImagePriority),
+                                               0 + FIELD_OFFSET_IN_HEADER(struct bcm_iso_header *, ISOImagePriority),
                                                SIGNATURE_SIZE,
                                                TRUE);
                        if (Status) {
@@ -3550,7 +3550,7 @@ int BcmCopyISO(struct bcm_mini_adapter *Adapter, struct bcm_flash2x_copy_section
        Status = BcmFlash2xBulkRead(Adapter,
                                &ISOLength,
                                sCopySectStrut.SrcSection,
-                               0 + FIELD_OFFSET_IN_HEADER(PISO_HEADER, ISOImageSize),
+                               0 + FIELD_OFFSET_IN_HEADER(struct bcm_iso_header *, ISOImageSize),
                                4);
        if (Status) {
                BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Read failed while copying ISO\n");
@@ -3561,7 +3561,7 @@ int BcmCopyISO(struct bcm_mini_adapter *Adapter, struct bcm_flash2x_copy_section
        if (ISOLength % Adapter->uiSectorSize)
                ISOLength = Adapter->uiSectorSize * (1 + ISOLength/Adapter->uiSectorSize);
 
-       sigOffset = FIELD_OFFSET_IN_HEADER(PISO_HEADER, ISOImageMagicNumber);
+       sigOffset = FIELD_OFFSET_IN_HEADER(struct bcm_iso_header *, ISOImageMagicNumber);
 
        Buff = kzalloc(Adapter->uiSectorSize, GFP_KERNEL);
 
@@ -3872,7 +3872,7 @@ int BcmFlash2xWriteSig(struct bcm_mini_adapter *Adapter, enum bcm_flash2x_sectio
        } else if ((eFlashSectionVal == ISO_IMAGE1) || (eFlashSectionVal == ISO_IMAGE2)) {
                uiSignature = htonl(ISO_IMAGE_MAGIC_NUMBER);
                /* uiOffset = 0; */
-               uiOffset = FIELD_OFFSET_IN_HEADER(PISO_HEADER, ISOImageMagicNumber);
+               uiOffset = FIELD_OFFSET_IN_HEADER(struct bcm_iso_header *, ISOImageMagicNumber);
                if ((ReadISOSignature(Adapter, eFlashSectionVal) & 0xFF000000) != CORRUPTED_PATTERN) {
                        BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Currupted Pattern is not there. Hence won't write sig");
                        return STATUS_FAILURE;
@@ -4148,7 +4148,7 @@ int SaveHeaderIfPresent(struct bcm_mini_adapter *Adapter, PUCHAR pBuff, unsigned
        if (uiSectAlignAddr == BcmGetSectionValStartOffset(Adapter, ISO_IMAGE1) ||
                uiSectAlignAddr == BcmGetSectionValStartOffset(Adapter, ISO_IMAGE2)) {
                offsetToProtect = 0;
-               HeaderSizeToProtect = sizeof(ISO_HEADER);
+               HeaderSizeToProtect = sizeof(struct bcm_iso_header);
                bHasHeader = TRUE;
        }
        /* If Header is present overwrite passed buffer with this */
@@ -4348,7 +4348,7 @@ int ReadISOSignature(struct bcm_mini_adapter *Adapter, enum bcm_flash2x_section_
 {
        unsigned int uiISOsig = 0;
        /* unsigned int sigoffsetInMap = 0;
-        * ISO_HEADER ISOHeader = {0};
+        * struct bcm_iso_header ISOHeader = {0};
         * sigoffsetInMap =(PUCHAR)&(ISOHeader.ISOImageMagicNumber) -(PUCHAR)&ISOHeader;
         */
        if (iso != ISO_IMAGE1 && iso != ISO_IMAGE2) {
@@ -4358,7 +4358,7 @@ int ReadISOSignature(struct bcm_mini_adapter *Adapter, enum bcm_flash2x_section_
        BcmFlash2xBulkRead(Adapter,
                        &uiISOsig,
                        iso,
-                       0 + FIELD_OFFSET_IN_HEADER(PISO_HEADER, ISOImageMagicNumber),
+                       0 + FIELD_OFFSET_IN_HEADER(struct bcm_iso_header *, ISOImageMagicNumber),
                        SIGNATURE_SIZE);
 
        uiISOsig = ntohl(uiISOsig);
@@ -4375,7 +4375,7 @@ int ReadISOPriority(struct bcm_mini_adapter *Adapter, enum bcm_flash2x_section_v
                        BcmFlash2xBulkRead(Adapter,
                                        &ISOPri,
                                        iso,
-                                       0 + FIELD_OFFSET_IN_HEADER(PISO_HEADER, ISOImagePriority),
+                                       0 + FIELD_OFFSET_IN_HEADER(struct bcm_iso_header *, ISOImagePriority),
                                        4);
 
                        ISOPri = ntohl(ISOPri);
index 7aed26376d1bfed2b74677065b2121a3dbbe7212..8554f73aac85402fd2d5ae88faeaa2773ca01fc4 100644 (file)
@@ -141,14 +141,14 @@ typedef struct _DSD_HEADER {
        u32 DSDImageMagicNumber;
 } DSD_HEADER, *PDSD_HEADER;
 
-typedef struct _ISO_HEADER {
+struct bcm_iso_header {
        u32 ISOImageMagicNumber;
        u32 ISOImageSize;
        u32 ISOImageCRC;
        u32 ISOImagePriority;
        /* We should not consider right now. Reading reserve is worthless. */
        u32 Reserved[60]; /* Resvd for ISO Header extension */
-} ISO_HEADER, *PISO_HEADER;
+};
 
 #define EEPROM_BEGIN_CIS       (0)
 #define EEPROM_BEGIN_NON_CIS   (0x200)