Re: [PATCH 3/5] staging: dgnc: Fix that open brace { should be on the previous line

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

 



On Wed, Aug 06, 2014 at 09:01:24PM +0200, Konrad Zapalowicz wrote:
> @@ -1935,8 +1935,8 @@ static void neo_vpd(struct dgnc_board *brd)
>  
>  	if  (((brd->vpd[0x08] != 0x82)	   /* long resource name tag */
>  		&&  (brd->vpd[0x10] != 0x82))   /* long resource name tag (PCI-66 files)*/
> -		||  (brd->vpd[0x7F] != 0x78))   /* small resource end tag */
> -	{
> +		||  (brd->vpd[0x7F] != 0x78)) { /* small resource end tag */
> +

This condition should really be written like this:

	if  ((brd->vpd[0x08] != 0x82 &&  /* long resource name tag */
	      brd->vpd[0x10] != 0x82) || /* (PCI-66 files) */
	     brd->vpd[0x7F] != 0x78) {   /* small resource end tag */

Except that the magical numbers should be defines and then we could
remove the comments.

This stuff could be changed in a later patch, no worries.

TODO-list: 2014-08-06: dgnc: Too many magic numbers

regards,
dan carpenter

>  		memset(brd->vpd, '\0', NEO_VPD_IMAGESIZE);
>  	} else {
>  		/* Search for the serial number */

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-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