[PATCH 2/7] vt6655: Fix most of checkpatch.pl errors in wroute

Dan Carpenter dan.carpenter at oracle.com
Tue Dec 31 11:12:25 UTC 2013


On Mon, Dec 30, 2013 at 03:52:32PM +0100, Michael Gunselmann wrote:
> wroute.h: Fixed all line-over-80-character errors. No errors remain.
> wroute.c: Fixed line-over-80-character errors, bracing errors
> 	  and C99-comments.
> 	  Three warnings remain, fixing them would deteriorate readability.
> 	  One warning on a memory barrier without comment in line 189
> 	  will be fixed in a later commit because it's purpose is not
> 	  yet known.
> 

Don't do the weird indenting.

> @@ -86,22 +88,25 @@ bool ROUTEbRelay(PSDevice pDevice, unsigned char *pbySkbData, unsigned int uData
>  
>  	pHeadTD->m_td1TD1.byTCR = (TCR_EDP | TCR_STP);
>  
> -	memcpy(pDevice->sTxEthHeader.abyDstAddr, (unsigned char *)pbySkbData, ETH_HLEN);
> +	memcpy(pDevice->sTxEthHeader.abyDstAddr,
> +	       (unsigned char *)pbySkbData, ETH_HLEN);
>  

It would be better to fix this like so:

	memcpy(pDevice->sTxEthHeader.abyDstAddr, pbySkbData, ETH_HLEN);

> -			}
> +			else
> +				pDevice->wCurrentRate =
> +					(unsigned short)pDevice->uConnectionRate;

Remove the silly cast here as well.

				pDevice->wCurrentRate = pDevice->uConnectionRate;

Both your patch and mine are still 81 characters long.

I don't get upset by lines over 80 characters...  Eventually we will fix
that.  Just leave it as-is, until we can clean it up from a human
perspective as well as from a checkpatch.pl robot perspective.

regards,
dan carpenter



More information about the devel mailing list