Re: [PATCH 18/25] staging: lustre: libcfs: clear up failure patch in cfs_cpt_*_print

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

 



> -err:
> -	if (rc < 0)
> -		return rc;
> -
>  	return tmp - buf;
> +
> +err:
> +	return -E2BIG;


We finally fixed this bug!  Hooray!  But it's like you guys are
deliberately writing in terrible style.  You can just return directly
and then you would have avoided this bug altogether from square one!

People think that by adding little twists and moving code to the end
of the function the it will be less buggy.  It's not true.  It's like at
a hospital if they just swept the cockroaches under the bed, just
because it's at the end of the function where you can't see it or review
it doesn't mean it's not buggy.

regards,
dan carpenter

_______________________________________________
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