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

Dan Carpenter dan.carpenter at oracle.com
Wed Jun 5 07:01:18 UTC 2013


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 at gmail.com>

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





More information about the devel mailing list