Re: [PATCH 02/67] staging: unisys: remove typedef for PERIODIC_WORK

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

 



On Tue, Sep 30, 2014 at 12:07:46PM -0400, Benjamin Romer wrote:
> -BOOL visor_periodic_work_nextperiod(PERIODIC_WORK *periodic_work)
> +BOOL visor_periodic_work_nextperiod(struct periodic_work *pw)
>  {
>  	BOOL rc = FALSE;
>  
> -	write_lock(&periodic_work->lock);
> -	if (periodic_work->want_to_stop) {
> -		periodic_work->is_scheduled = FALSE;
> -		periodic_work->want_to_stop = FALSE;
> +	write_lock(&pw->lock);
> +	if (pw->want_to_stop) {
> +		pw->is_scheduled = FALSE;
> +		pw->want_to_stop = FALSE;
>  		rc = TRUE;  /* yes, TRUE; see visor_periodic_work_stop() */
> -		goto Away;
> -	} else if (queue_delayed_work(periodic_work->workqueue,
> -				      &periodic_work->work,
> -				      periodic_work->jiffy_interval) < 0) {
> -		ERRDEV(periodic_work->devnam, "queue_delayed_work failed!");
> -		periodic_work->is_scheduled = FALSE;
> +		goto unlock;
> +	} else if (queue_delayed_work(pw->workqueue, &pw->work,
> +				      pw->jiffy_interval) < 0) {

This triggeres a static checker warning now that we're using bool
instead of BOOL (int) because bool is never negative.

> +		ERRDEV(pw->devnam, "queue_delayed_work failed!");
> +		pw->is_scheduled = FALSE;
>  		rc = FALSE;
> -		goto Away;
> +		goto unlock;
>  	}
>  	rc = TRUE;
> -Away:
> -	write_unlock(&periodic_work->lock);
> +unlock:
> +	write_unlock(&pw->lock);
>  	return rc;
>  }

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