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

Dan Carpenter dan.carpenter at oracle.com
Sat May 9 08:34:56 UTC 2015


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



More information about the devel mailing list