Re: [staging-next 1/4] staging/easycap: don't cast NULL pointer

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

 



On Tue, Jan 25, 2011 at 05:33:27PM +0200, Tomas Winkler wrote:
>  	pusb_interface_descriptor = &(pusb_host_interface->desc);
> -	if ((struct usb_interface_descriptor *)NULL ==
> +	if (NULL ==
>  						pusb_interface_descriptor) {

You could move the if condition onto one line now.

> -			if ((void *)NULL != peasycap->field_buffer[k][m].pgo) {
> +			if (NULL != peasycap->field_buffer[k][m].pgo) {

Btw.  Am I the only person who gets confused by all the double
negatives?  If false is not equal to peasycap->field_buffer[k][m].pgo
then ... vs if peasycap->field_buffer[k][m].pgo ... ?  It's more
idiomatic to say: if (foo) { ... and if (!foo) { ... 

> -			if ((struct data_urb *)NULL != pdata_urb) {
> -				if ((struct urb *)NULL !=
> +			if (NULL != pdata_urb) {
> +				if (NULL !=
>  						pdata_urb->purb) {

Same here.  Move this to one line.

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