Staging: wlags49_h2: Hoist assign from if
authorJoe Perches <joe@perches.com>
Thu, 25 Mar 2010 05:17:07 +0000 (22:17 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 11 May 2010 18:35:45 +0000 (11:35 -0700)
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/wlags49_h2/hcf.c
drivers/staging/wlags49_h2/wl_main.c
drivers/staging/wlags49_h2/wl_netdev.c
drivers/staging/wlags49_h2/wl_priv.c
drivers/staging/wlags49_h2/wl_sysfs.c

index 6e39f5081e27469a229e11495d6d07db19917056..390628c6c1ebe900c1e46586a080e92418da6475 100644 (file)
@@ -990,7 +990,8 @@ int rc = HCF_ERR_INCOMP_FW;
                        ifbp->IFB_CntlOpt |= DMA_ENABLED;
                        HCFASSERT( NT_ASSERT, NEVER_TESTED )
                        // make the entire rx descriptor chain DMA-owned, so the DMA engine can (re-)use it.
-                       if ( ( p = ifbp->IFB_FirstDesc[DMA_RX] ) != NULL ) {   //;? Think this over again in the light of the new chaining strategy
+                       p = ifbp->IFB_FirstDesc[DMA_RX];
+                       if (p != NULL) {   //;? Think this over again in the light of the new chaining strategy
                                if ( 1 )        { //begin alternative
                                        HCFASSERT( NT_ASSERT, NEVER_TESTED )
                                        put_frame_lst( ifbp, ifbp->IFB_FirstDesc[DMA_RX], DMA_RX );
@@ -2087,7 +2088,8 @@ wci_bufp  pt;                                     //pointer with the "right" type, just to help ease writing macr
                        OPW( HREG_AUX_OFFSET, (hcf_16)(PLUG_DATA_OFFSET & 0x7E) );
                        io_port = ifbp->IFB_IOBase + HREG_AUX_DATA;             //to prevent side effects of the MSF-defined macro
                        p = ltvp->val;                                  //destination char pointer (in LTV record)
-                       if ( ( i = len - 1 ) > 0 ) {
+                       i = len - 1;
+                       if (i > 0 ) {
                                pt = (wci_bufp)p;       //just to help ease writing macros with embedded assembly
                                IN_PORT_STRING_8_16( io_port, pt, i ); //space used by T: -1
                        }
@@ -2674,7 +2676,8 @@ hcf_16            fid = 0;
 
 #if (HCF_EXT) & HCF_EXT_TX_CONT                                // Continuous transmit test
        if ( tx_cntl == HFS_TX_CNTL_TX_CONT ) {
-               if ( ( fid = get_fid( ifbp ) ) != 0 ) {
+               fid = get_fid(ifbp);
+               if (fid != 0 ) {
                                                                                        //setup BAP to begin of TxFS
                        (void)setup_bap( ifbp, fid, 0, IO_OUT );
                                                                                        //copy all the fragments in a transparent fashion
@@ -2700,7 +2703,8 @@ hcf_16            fid = 0;
 #if (HCF_TYPE) & HCF_TYPE_WPA
        tx_cntl |= ifbp->IFB_MICTxCntl;
 #endif // HCF_TYPE_WPA
-       if ( (fid = ifbp->IFB_TxFID) == 0 && ( fid = get_fid( ifbp ) ) != 0 )           /* 4 */
+       fid = ifbp->IFB_TxFID;
+       if (fid == 0 && ( fid = get_fid( ifbp ) ) != 0 )                /* 4 */
                        /* skip the next compound statement if:
                           - pre-put message or
                           - no fid available (which should never occur if the MSF adheres to the WCI)
@@ -4860,7 +4864,8 @@ PROT_CNT_INI
 int    rc;
 
        HCFTRACE( ifbp, HCF_TRACE_STRIO );
-       if ( ( rc = ifbp->IFB_DefunctStat ) == HCF_SUCCESS ) {                                                                          /*2*/
+       rc = ifbp->IFB_DefunctStat;
+       if (rc == HCF_SUCCESS) {                                                                                /*2*/
                OPW( HREG_SELECT_1, fid );                                                                                                                              /*4*/
                OPW( HREG_OFFSET_1, offset );
                if ( type == IO_IN ) {
index cf0c38468b201c98b326aca5449b0ca9a86d8927..88d0d472142fde3334516a2166ce6e80904f945f 100644 (file)
@@ -3591,7 +3591,8 @@ int scull_read_procmem(char *buf, char **start, off_t offset, int len, int *eof,
 
     len=0;
 
-       if ( ( lp = ((struct net_device *)data)->priv ) == NULL ) {
+       lp = ((struct net_device *)data)->priv;
+       if (lp == NULL) {
         len += sprintf(buf+len,"No wl_private in scull_read_procmem\n" );
        } else if ( lp->wlags49_type == 0 ){
            ifbp = &lp->hcfCtx;
index 1db73ebcae28798407b9e02eb65a6ca2cc27c409..1cfaee3a23500cf6a47ea653b6091ea0cb4cd3ff 100644 (file)
@@ -930,8 +930,10 @@ int wl_rx(struct net_device *dev)
         port = ( hfs_stat >> 8 ) & 0x0007;
         DBG_RX( DbgInfo, "Rx frame for port %d\n", port );
 
-        if(( pktlen = lp->hcfCtx.IFB_RxLen ) != 0 ) {
-            if(( skb = ALLOC_SKB( pktlen )) != NULL ) {
+        pktlen = lp->hcfCtx.IFB_RxLen;
+        if (pktlen != 0) {
+            skb = ALLOC_SKB(pktlen);
+            if (skb != NULL) {
                 /* Set the netdev based on the port */
                 switch( port ) {
 #ifdef USE_WDS
@@ -1995,8 +1997,10 @@ int wl_rx_dma( struct net_device *dev )
                 port = ( hfs_stat >> 8 ) & 0x0007;
                 DBG_RX( DbgInfo, "Rx frame for port %d\n", port );
 
-                if(( pktlen = GET_BUF_CNT( desc_next )) != 0 ) {
-                    if(( skb = ALLOC_SKB( pktlen )) != NULL ) {
+                pktlen = GET_BUF_CNT(desc_next);
+                if (pktlen != 0) {
+                    skb = ALLOC_SKB(pktlen);
+                    if (skb != NULL) {
                         switch( port ) {
 #ifdef USE_WDS
                         case 1:
index 727ea8a483af313d7bd3b855db44ca0f6e6b23f2..a67ff529d359a5e255a9e821f4bc29242f89113f 100644 (file)
@@ -503,7 +503,8 @@ int wvlan_uil_send_diag_msg( struct uilreq *urq, struct wl_private *lp )
                                                return result;
                                        }
 
-                                       if ((data = kmalloc(urq->len, GFP_KERNEL)) != NULL) {
+                                       data = kmalloc(urq->len, GFP_KERNEL);
+                                       if (data != NULL) {
                                                memset( Descp, 0, sizeof( DESC_STRCT ));
                                                memcpy( data, urq->data, urq->len );
 
@@ -617,7 +618,8 @@ int wvlan_uil_put_info( struct uilreq *urq, struct wl_private *lp )
                                   LTV record, try to allocate it from the kernel stack.
                                   Otherwise, we just use our local LTV record. */
                                if( urq->len > sizeof( lp->ltvRecord )) {
-                                       if(( pLtv = (ltv_t *)kmalloc( urq->len, GFP_KERNEL )) != NULL ) {
+                                       pLtv = (ltv_t *)kmalloc( urq->len, GFP_KERNEL );
+                                       if (pLtv != NULL) {
                                                ltvAllocated = TRUE;
                                        } else {
                                                DBG_ERROR( DbgInfo, "Alloc FAILED\n" );
@@ -1296,7 +1298,8 @@ int wvlan_uil_get_info( struct uilreq *urq, struct wl_private *lp )
                                   LTV record, try to allocate it from the kernel stack.
                                   Otherwise, we just use our local LTV record. */
                                if( urq->len > sizeof( lp->ltvRecord )) {
-                                       if(( pLtv = (ltv_t *)kmalloc( urq->len, GFP_KERNEL )) != NULL ) {
+                                       pLtv = (ltv_t *)kmalloc( urq->len, GFP_KERNEL );
+                                       if (pLtv != NULL) {
                                                ltvAllocated = TRUE;
 
                                                /* Copy the command/length information into the new buffer. */
index 864e01a736c87c396eaccd1f741f80c8f4404527..e4c8804ac37d81821d3f5bec356cd0ba9348aeda 100644 (file)
@@ -46,7 +46,8 @@ static ssize_t show_tallies(struct device *d, struct device_attribute *attr,
     if (dev_isalive(dev)) {
        wl_lock(lp, &flags);
 
-       if ((ret = wl_get_tallies(lp, &tallies)) == 0) {
+       ret = wl_get_tallies(lp, &tallies);
+       if (ret == 0) {
                wl_unlock(lp, &flags);
                ret = snprintf(buf, PAGE_SIZE,
                    "TxUnicastFrames:           %u\n"