Re: [PATCH 21/28] staging: most: fix retrieval of buffer availability

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

 



On Tue, Dec 22, 2015 at 10:53:02AM +0100, Christian Gromm wrote:
> This patch fixes the function channel_has_mbo that delivers the false
> information in case two AIMs are using the same tx channel.
> 
> Signed-off-by: Christian Gromm <christian.gromm@xxxxxxxxxxxxx>
> ---
> 
<snip>
> diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c
> index b085f0a..ff0e0dc 100644
> --- a/drivers/staging/most/mostcore/core.c
> +++ b/drivers/staging/most/mostcore/core.c
> @@ -1352,7 +1352,7 @@ most_c_obj *get_channel_by_iface(struct most_interface *iface, int id)
>  	return i->channel[id];
>  }
>  
> -int channel_has_mbo(struct most_interface *iface, int id)
> +int channel_has_mbo(struct most_interface *iface, int id, struct most_aim *aim)
>  {
>  	struct most_c_obj *c = get_channel_by_iface(iface, id);
>  	unsigned long flags;
> @@ -1361,6 +1361,11 @@ int channel_has_mbo(struct most_interface *iface, int id)
>  	if (unlikely(!c))
>  		return -EINVAL;
>  
> +	if (c->aim0.refs && c->aim1.refs &&
> +	    ((aim == c->aim0.ptr && c->aim0.num_buffers <= 0) ||
> +	     (aim == c->aim1.ptr && c->aim1.num_buffers <= 0)))
> +		return false;

channel_has_mbo() return int. maybe return 0 instead of return false..

regards
sudip
_______________________________________________
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