Re: [PATCH 3/8] staging: rtl8192u: add spaces around ?:&&|| in r8192U_core.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 04, 2013 at 11:32:28PM +0300, Xenia Ragiadakou wrote:
> This patch fixes the following checkpatch errors:
> ERROR: spaces required around that '?'
> ERROR: spaces required around that ':'
> ERROR: spaces required around that '&&'
> ERROR: spaces required around that '||'
> 
> Signed-off-by: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>

This patch is fine, but there is more cleanup that could be done in
a later patch if you wanted to.

> @@ -1161,15 +1161,15 @@ struct sk_buff *DrvAggr_Aggregation(struct net_device *dev, struct ieee80211_drv
>  		}
>  
>  		/* Protection mode related */
> -		tx_fwinfo->RtsEnable = (tcb_desc->bRTSEnable)?1:0;
> -		tx_fwinfo->CtsEnable = (tcb_desc->bCTSEnable)?1:0;
> -		tx_fwinfo->RtsSTBC = (tcb_desc->bRTSSTBC)?1:0;
> -		tx_fwinfo->RtsHT = (tcb_desc->rts_rate&0x80)?1:0;
> +		tx_fwinfo->RtsEnable = (tcb_desc->bRTSEnable) ? 1 : 0;
> +		tx_fwinfo->CtsEnable = (tcb_desc->bCTSEnable) ? 1 : 0;
> +		tx_fwinfo->RtsSTBC = (tcb_desc->bRTSSTBC) ? 1 : 0;

Both sides of this are 1 bit bit fields so it could just be written
like this:

		tx_fwinfo->RtsSTBC = tcb_desc->bRTSSTBC;


> +		tx_fwinfo->RtsHT = (tcb_desc->rts_rate&0x80) ? 1 : 0;

The spacing on this should really be:

		tx_fwinfo->RtsHT = (tcb_desc->rts_rate & 0x80) ? 1 : 0;

Btw, the whole section where we setup tx_fwinfo could be pulled into
a separate function:

	setup_tx_fwinfo(tx_fwinfo, priv, tcb_desc);

regards,
dan carpenter


_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux