Re: [PATCH] Summary: Fixed all the indents and other errors in IEEE11h.c

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

 



On Sun, Jul 17, 2011 at 01:38:29AM +0200, Toon Schoenmakers wrote:

> +	uNumOfEIDs = ((uLength - offsetof(WLAN_FRAME_MSRREQ,
> +			sMSRReqEIDs))/
> +			(sizeof(WLAN_IE_MEASURE_REQ)));

It would be better to write this in C instead of Lisp:

	uNumOfEIDs = (uLength - offsetof(WLAN_FRAME_MSGREQ, sMSRReqEIDS)) /
			sizeof(WLAN_EI_MEASURE_REQ);

The other advantage of that is that the call to offsetof() is now
all together on one line.

> +	pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket +
> +sizeof(STxMgmtPacket));
> +
> +	pFrame = (PWLAN_FRAME_TPCREP)((unsigned char *)pTxPacket +
> +sizeof(STxMgmtPacket));
> +

Don't do that.

> +	pFrame->Header.wFrameCtl = (WLAN_SET_FC_FTYPE(WLAN_FTYPE_MGMT) |
> +				WLAN_SET_FC_FSTYPE(WLAN_FSTYPE_ACTION)
> +				);

The close parenthesis can fit on the end of the other line.  In fact
the paren is not needed at all.  Why is the second line aligned where
you have it?  The WLAN_SET_FC_FSTYPE() isn't aligned with anything.

Take a another look through the patch and you'll find a bunch of
similar issues.

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