Staging: rt28x0: fix some build warnings
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Wed, 21 Oct 2009 20:44:42 +0000 (22:44 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Dec 2009 20:23:12 +0000 (12:23 -0800)
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 files changed:
drivers/staging/rt2860/chip/rtmp_phy.h
drivers/staging/rt2860/chips/rt30xx.c
drivers/staging/rt2860/common/cmm_asic.c
drivers/staging/rt2860/common/cmm_mac_pci.c
drivers/staging/rt2860/common/mlme.c
drivers/staging/rt2860/common/rtmp_init.c
drivers/staging/rt2860/common/rtmp_mcu.c
drivers/staging/rt2860/pci_main_dev.c
drivers/staging/rt2860/rt_linux.c
drivers/staging/rt2860/rt_main_dev.c
drivers/staging/rt2860/sta/connect.c
drivers/staging/rt2860/usb_main_dev.c

index 87516f3a111a11599b5e64728dacd26454c04b6d..e2b90a14bf6c1afb94944dfc0058b7560c45e4a0 100644 (file)
 #ifdef RT30xx
 #define RTMP_ASIC_MMPS_DISABLE(_pAd)                                                   \
        do{                                                                                                                     \
-               UCHAR _bbpData;                                                                                 \
-               UINT32 _macData;                                                                                        \
+               UINT32 _macData; \
+               UCHAR _bbpData = 0; \
                /* disable MMPS BBP control register */                                         \
                RTMP_BBP_IO_READ8_BY_REG_ID(_pAd, BBP_R3, &_bbpData);   \
                _bbpData &= ~(0x04);    /*bit 2*/                                                               \
 
 #define RTMP_ASIC_MMPS_ENABLE(_pAd)                                                    \
        do{                                                                                                                     \
-               UCHAR _bbpData;                                                                                 \
-               UINT32 _macData;                                                                                        \
+               UINT32 _macData; \
+               UCHAR _bbpData = 0; \
                /* enable MMPS BBP control register */                                          \
                RTMP_BBP_IO_READ8_BY_REG_ID(_pAd, BBP_R3, &_bbpData);   \
                _bbpData |= (0x04);     /*bit 2*/                                                               \
index f29d11d6de47847fa2ed66c4e53bb0ec90c1050b..c69fab568984e0b8b17430db74182c6c01be86c2 100644 (file)
@@ -86,7 +86,9 @@ VOID RT30xxSetRxAnt(
        IN UCHAR                        Ant)
 {
        UINT32  Value;
+#ifdef RTMP_MAC_PCI
        UINT32  x;
+#endif
 
        if ((pAd->EepromAccess) ||
                (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS))  ||
index 5d3a387f76a2a348e984a7d8dbc308f412f62b05..406e0bbf9530a3313497fbad3333f1b06b3f7d45 100644 (file)
@@ -810,9 +810,9 @@ VOID AsicSwitchChannel(
 
 #if defined(RT3090) || defined(RT3390)
                // PCIe PHY Transmit attenuation adjustment
-               if (IS_RT3090A(pAd) || IS_RT3390(pAd))
-               {
-                       TX_ATTENUATION_CTRL_STRUC TxAttenuationCtrl = {0};
+               if (IS_RT3090A(pAd) || IS_RT3390(pAd)) {
+                       TX_ATTENUATION_CTRL_STRUC
+                               TxAttenuationCtrl = { .word = 0 };
 
                        RTMP_IO_READ32(pAd, PCIE_PHY_TX_ATTENUATION_CTRL, &TxAttenuationCtrl.word);
 
index 73992cb4ee6745384d115538ab678d77826c4d59..d910bfdbd2f361b3b78db717f2cb59d1d2cb2b9a 100644 (file)
@@ -1173,10 +1173,9 @@ BOOLEAN RT28xxPciAsicRadioOn(
            pAd->Mlme.bPsPollTimerRunning = FALSE;
                RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled);
                }
-               if ((pAd->StaCfg.PSControl.field.EnableNewPS == TRUE)&&
-               ((Level == GUIRADIO_OFF) || (Level == GUI_IDLE_POWER_SAVE))
-               ||(RTMP_TEST_PSFLAG(pAd, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND)))
-               {
+               if ((pAd->StaCfg.PSControl.field.EnableNewPS == TRUE &&
+                    (Level == GUIRADIO_OFF || Level == GUI_IDLE_POWER_SAVE)) ||
+                   RTMP_TEST_PSFLAG(pAd, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND)) {
                        // Some chips don't need to delay 6ms, so copy RTMPPCIePowerLinkCtrlRestore
                        // return condition here.
                        /*
index 7647c090c349e38c0d064895a98ff3b26d786bed..9fa853eba672104ef938118427062d2eebdb7418 100644 (file)
@@ -679,7 +679,6 @@ VOID MlmePeriodicExec(
 {
        ULONG                   TxTotalCnt;
        PRTMP_ADAPTER   pAd = (RTMP_ADAPTER *)FunctionContext;
-       SHORT   realavgrssi;
 
 #ifdef RTMP_MAC_PCI
        {
index fe8327b9b13c42552323e807b93a3bc2887533eb..5deba8d698c5f1733d34656b776d84256bd1350f 100644 (file)
@@ -3621,7 +3621,8 @@ INT RtmpRaDevCtrlInit(
 
 #ifdef RTMP_MAC_USB
        init_MUTEX(&(pAd->UsbVendorReq_semaphore));
-       os_alloc_mem(pAd, (PUCHAR)&pAd->UsbVendorReqBuf, MAX_PARAM_BUFFER_SIZE - 1);
+       os_alloc_mem(pAd, (PUCHAR *)&pAd->UsbVendorReqBuf,
+                    MAX_PARAM_BUFFER_SIZE - 1);
        if (pAd->UsbVendorReqBuf == NULL)
        {
                DBGPRINT(RT_DEBUG_ERROR, ("Allocate vendor request temp buffer failed!\n"));
index 229ea05e9336d283abd584ace71f8195ad273b8a..e5d19020ef7a7dec082a77b6e3786809231317c0 100644 (file)
@@ -119,7 +119,9 @@ NDIS_STATUS RtmpAsicLoadFirmware(
        PUCHAR                  pFirmwareImage = NULL;
        ULONG                   FileLength, Index;
        UINT32                  MacReg = 0;
+#ifdef RTMP_MAC_USB
        UINT32                  Version = (pAd->MACVersion >> 16);
+#endif
 
        // New 8k byte firmware size for RT3071/RT3072
        {
index 1436a60e894b816e4e2b3e0226d3beac451565f5..38bc429067e27e012cbac8618c133db30977d841 100644 (file)
@@ -310,7 +310,7 @@ static INT __devinit   rt2860_probe(
                return rv;
        }
 
-       print_name = pci_name(pci_dev);
+       print_name = (PSTRING)pci_name(pci_dev);
 
        if ((rv = pci_request_regions(pci_dev, print_name)) != 0)
        {
@@ -883,7 +883,7 @@ VOID RTMPPCIeLinkCtrlValueRestore(
 #endif // RT2860 //
        // Check PSControl Configuration
        if (pAd->StaCfg.PSControl.field.EnableNewPS == FALSE)
-               return TRUE;
+               return;
 
        //3090 will not execute the following codes.
        // Check interface : If not PCIe interface, return.
@@ -977,7 +977,7 @@ VOID RTMPPCIeLinkCtrlSetting(
 #endif // RT2860 //
        // Check PSControl Configuration
        if (pAd->StaCfg.PSControl.field.EnableNewPS == FALSE)
-               return TRUE;
+               return;
 
        // Check interface : If not PCIe interface, return.
        //Block 3090 to enter the following function
@@ -1086,17 +1086,17 @@ VOID RTMPrt3xSetPCIePowerLinkCtrl(
        IN      PRTMP_ADAPTER   pAd)
 {
 
-       ULONG   HostConfiguration;
+       ULONG   HostConfiguration = 0;
        ULONG   Configuration;
-       ULONG   Vendor;
-       ULONG   offset;
        POS_COOKIE      pObj;
        INT     pos;
        USHORT  reg16;
 
        pObj = (POS_COOKIE) pAd->OS_Cookie;
 
-       DBGPRINT(RT_DEBUG_INFO, ("RTMPrt3xSetPCIePowerLinkCtrl.===> %x\n", pAd->StaCfg.PSControl.word));
+       DBGPRINT(RT_DEBUG_INFO,
+                ("RTMPrt3xSetPCIePowerLinkCtrl.===> %lx\n",
+                 pAd->StaCfg.PSControl.word));
 
        // Check PSControl Configuration
        if (pAd->StaCfg.PSControl.field.EnableNewPS == FALSE)
@@ -1104,7 +1104,6 @@ VOID RTMPrt3xSetPCIePowerLinkCtrl(
        RTMPFindHostPCIDev(pAd);
         if (pObj->parent_pci_dev)
         {
-               USHORT  vendor_id;
                // Find PCI-to-PCI Bridge Express Capability Offset
                pos = pci_find_capability(pObj->parent_pci_dev, PCI_CAP_ID_EXP);
 
@@ -1129,7 +1128,10 @@ VOID RTMPrt3xSetPCIePowerLinkCtrl(
                                // Because in rt30xxForceASPMTest Mode, Force turn on L0s, L1.
                                // Fix HostConfiguration bit0:1 = 0x3 for later use.
                                HostConfiguration = 0x3;
-                               DBGPRINT(RT_DEBUG_TRACE, ("PSM : Force ASPM : Host device L1/L0s Value =  0x%x\n", HostConfiguration));
+                               DBGPRINT(RT_DEBUG_TRACE,
+                                        ("PSM : Force ASPM : "
+                                         "Host device L1/L0s Value =  0x%lx\n",
+                                         HostConfiguration));
                        }
                }
                else if (pAd->StaCfg.PSControl.field.rt30xxFollowHostASPM == 1)
@@ -1141,7 +1143,10 @@ VOID RTMPrt3xSetPCIePowerLinkCtrl(
                         PCI_REG_READ_WORD(pObj->parent_pci_dev, pAd->HostLnkCtrlOffset, HostConfiguration);
                                pAd->Rt3xxHostLinkCtrl = HostConfiguration;
                                HostConfiguration &= 0x3;
-                               DBGPRINT(RT_DEBUG_TRACE, ("PSM : Follow Host ASPM : Host device L1/L0s Value =  0x%x\n", HostConfiguration));
+                               DBGPRINT(RT_DEBUG_TRACE,
+                                        ("PSM : Follow Host ASPM : "
+                                         "Host device L1/L0s Value =  0x%lx\n",
+                                         HostConfiguration));
                        }
                }
         }
@@ -1155,8 +1160,10 @@ VOID RTMPrt3xSetPCIePowerLinkCtrl(
        pAd->RLnkCtrlOffset = pos + PCI_EXP_LNKCTL;
        pci_read_config_word(pObj->pci_dev, pAd->RLnkCtrlOffset, &reg16);
         Configuration = le2cpu16(reg16);
-       DBGPRINT(RT_DEBUG_TRACE, ("Read (Ralink PCIe Link Control Register) offset 0x%x = 0x%x\n",
-                                                           pAd->RLnkCtrlOffset, Configuration));
+               DBGPRINT(RT_DEBUG_TRACE,
+                        ("Read (Ralink PCIe Link Control Register) "
+                         "offset 0x%x = 0x%lx\n",
+                         pAd->RLnkCtrlOffset, Configuration));
                Configuration |= 0x100;
                if ((pAd->StaCfg.PSControl.field.rt30xxFollowHostASPM == 1)
                        || (pAd->StaCfg.PSControl.field.rt30xxForceASPMTest == 1))
@@ -1182,7 +1189,9 @@ VOID RTMPrt3xSetPCIePowerLinkCtrl(
                reg16 = cpu2le16(Configuration);
                pci_write_config_word(pObj->pci_dev, pAd->RLnkCtrlOffset, reg16);
                pAd->Rt3xxRalinkLinkCtrl = Configuration;
-               DBGPRINT(RT_DEBUG_TRACE, ("PSM :Write Ralink device L1/L0s Value =  0x%x\n", Configuration));
+               DBGPRINT(RT_DEBUG_TRACE,
+                        ("PSM :Write Ralink device L1/L0s Value =  0x%lx\n",
+                         Configuration));
        }
        DBGPRINT(RT_DEBUG_INFO,("PSM :RTMPrt3xSetPCIePowerLinkCtrl <==============\n"));
 }
index cdda24724c5bf891c1a79c43045d1d06f62111ee..d57013fb7bf1f4e5dd54e364b2efd1ca6e1ecf39 100644 (file)
@@ -965,6 +965,7 @@ err_free_sk_buff:
  *******************************************************************************/
 int RtmpOSIRQRequest(IN PNET_DEV pNetDev)
 {
+#ifdef RTMP_PCI_SUPPORT
        struct net_device *net_dev = pNetDev;
        PRTMP_ADAPTER pAd = NULL;
        int retval = 0;
@@ -973,7 +974,6 @@ int RtmpOSIRQRequest(IN PNET_DEV pNetDev)
 
        ASSERT(pAd);
 
-#ifdef RTMP_PCI_SUPPORT
        if (pAd->infType == RTMP_DEV_INF_PCI)
        {
                POS_COOKIE _pObj = (POS_COOKIE)(pAd->OS_Cookie);
@@ -982,14 +982,13 @@ int RtmpOSIRQRequest(IN PNET_DEV pNetDev)
                if (retval != 0)
                        printk("RT2860: request_irq  ERROR(%d)\n", retval);
        }
-#endif // RTMP_PCI_SUPPORT //
-
 
        return retval;
-
+#else
+       return 0;
+#endif
 }
 
-
 int RtmpOSIRQRelease(IN PNET_DEV pNetDev)
 {
        struct net_device *net_dev = pNetDev;
@@ -1149,7 +1148,6 @@ NDIS_STATUS RtmpOSTaskAttach(
        IN void *arg)
 {
        NDIS_STATUS status = NDIS_STATUS_SUCCESS;
-       pid_t pid_number = -1;
 
 #ifdef KTHREAD_SUPPORT
        pTask->task_killed = 0;
index 7ea85e6a3363e15b80284c68cbeee47625bbcf54..3a735717bcf6772a54e453113d7e4e88e3e5d81a 100644 (file)
@@ -209,15 +209,13 @@ int rt28xx_close(IN PNET_DEV dev)
        BOOLEAN                 Cancelled;
        UINT32                  i = 0;
 
-       GET_PAD_FROM_NET_DEV(pAd, net_dev);
-
 #ifdef RTMP_MAC_USB
        DECLARE_WAIT_QUEUE_HEAD(unlink_wakeup);
        DECLARE_WAITQUEUE(wait, current);
-
-       //RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_REMOVE_IN_PROGRESS);
 #endif // RTMP_MAC_USB //
 
+       GET_PAD_FROM_NET_DEV(pAd, net_dev);
+
     DBGPRINT(RT_DEBUG_TRACE, ("===> rt28xx_close\n"));
 
        Cancelled = FALSE;
index 7f263a66d79a4bde7e301425c664df33086c04b7..43edd8e1f284797b096e54a0910922ea5722da6b 100644 (file)
@@ -1809,7 +1809,6 @@ VOID LinkDown(
        IN  BOOLEAN      IsReqFromAP)
 {
        UCHAR                       i, ByteValue = 0;
-       BOOLEAN         Cancelled;
 
        // Do nothing if monitor mode is on
        if (MONITOR_ON(pAd))
index 16e1bbfce435dd3154b0cc8cc8e058e09168c184..00732be4f00548f25bac3fa9a0294dfe163f49df 100644 (file)
@@ -686,9 +686,10 @@ VOID RTUSBWatchDog(IN RTMP_ADAPTER *pAd)
 
                                RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[idx], irqFlags);
 
-
-                               printk("%d:%d LTL=%d , TL=%d L:%d\n",idx,pAd->watchDogTxPendingCnt[idx],pAd->TransferedLength[idx]
-                                       ,actual_length,transfer_buffer_length);
+                               printk(KERN_INFO "%d:%lu LTL=%d , TL=%d L:%d\n",
+                                      idx, pAd->watchDogTxPendingCnt[idx],
+                                      pAd->TransferedLength[idx],
+                                      actual_length, transfer_buffer_length);
 
                                if (pUrb)
                                {