[PATCH 5/5] staging: bcm: fix errors and warnings by checkpatch.pl in IPv6Protocol.c

Dan Carpenter dan.carpenter at oracle.com
Tue Feb 21 20:05:10 UTC 2012


On Tue, Feb 21, 2012 at 09:36:18AM -0800, Pradheep wrote:
> -static UCHAR * GetNextIPV6ChainedHeader(UCHAR **ppucPayload,UCHAR *pucNextHeader,BOOLEAN *bParseDone,USHORT *pusPayloadLength)
> +static UCHAR *GetNextIPV6ChainedHeader(UCHAR **ppucPayload, UCHAR *pucNextHeader, BOOLEAN *bParseDone, USHORT *pusPayloadLength)
>  {
>  	UCHAR *pucRetHeaderPtr = NULL;
>  	UCHAR *pucPayloadPtr = NULL;
> -	USHORT  usNextHeaderOffset = 0 ;
> -    PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev);
> +	USHORT  usNextHeaderOffset = 0;
> +	int nTotalOptions = 0;
> +	int nHdrLen = 0;

Could we move nTotalOptions and nHdrLen back as well?

>  
> -	if((NULL == ppucPayload) || (*pusPayloadLength == 0) || (*bParseDone))
> -	{
> +	PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev);

Move the Adapter up with the other declarations, then and leave a
blank line after the declarations.

Really, I think you would have noticed these but this patch does too
many things at once.  Maybe just fix all the tabs and white space in
one patch then fix all the braces warnings in the next patch.

> +		bClassificationSucceed = MatchSrcIpv6Address(pstClassifierRule, pstIpv6Header);
> +		if (!bClassificationSucceed)
> +		    break;
		^^^^
Uh.  Some of these were correct in the original code, but now they
are using four space indents?

Is the problem that the lines are too long?  Really the correct fix
there is to choose shorter variable names, and to break things up
into functions.

regards,
dan carpenter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/attachments/20120221/e156c6e1/attachment.asc>


More information about the devel mailing list