Re: [PATCH 05/30] staging: unisys: fix function visorchannel_signalremove from bool to int

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

 



On Tue, Feb 10, 2015 at 12:58:39PM -0500, Benjamin Romer wrote:
> From: Erik Arfvidson <erik.arfvidson@xxxxxxxxxx>
> 
> this patch changes visorchannel_signalremove from bool to int. Also modified
> signalremove_inner since the return value was bool and change it to int.
> 
> Signed-off-by: Erik Arfvidson <erik.arfvidson@xxxxxxxxxx>
> Signed-off-by: Benjamin Romer <benjamin.romer@xxxxxxxxxx>
> ---
>  drivers/staging/unisys/visorchannel/visorchannel.h     |  2 +-
>  .../staging/unisys/visorchannel/visorchannel_funcs.c   | 18 +++++++++---------
>  2 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/unisys/visorchannel/visorchannel.h b/drivers/staging/unisys/visorchannel/visorchannel.h
> index 63f1b97..5b4ff15 100644
> --- a/drivers/staging/unisys/visorchannel/visorchannel.h
> +++ b/drivers/staging/unisys/visorchannel/visorchannel.h
> @@ -52,7 +52,7 @@ int visorchannel_write(struct visorchannel *channel, ulong offset,
>  		       void *local, ulong nbytes);
>  int visorchannel_clear(struct visorchannel *channel, ulong offset,
>  		       u8 ch, ulong nbytes);
> -BOOL visorchannel_signalremove(struct visorchannel *channel, u32 queue,
> +int visorchannel_signalremove(struct visorchannel *channel, u32 queue,
>  			       void *msg);
>  BOOL visorchannel_signalinsert(struct visorchannel *channel, u32 queue,
>  			       void *msg);
> diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
> index 0188ef8..68befd6 100644
> --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
> +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
> @@ -411,21 +411,21 @@ safe_sig_queue_validate(struct signal_queue_header *psafe_sqh,
>  	return 1;
>  }				/* end safe_sig_queue_validate */
>  
> -static BOOL
> +static int
>  signalremove_inner(struct visorchannel *channel, u32 queue, void *msg)

You also need to change the logic of the function that calls this,
right?

>  {
>  	struct signal_queue_header sig_hdr;
>  
>  	if (!sig_read_header(channel, queue, &sig_hdr)) {
> -		return FALSE;
> +		return 0;
>  	}
>  	if (sig_hdr.head == sig_hdr.tail)
> -		return FALSE;	/* no signals to remove */
> +		return 0;	/* no signals to remove */

"traditionally" 0 means "all went just fine, which is not what you are
meaning here.

So if you are going to move away from bool as a return type, do it
correctly, and fix up the callers as well.

I'll stop reviewing this series now.

thanks,

greg k-h
_______________________________________________
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