From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id DCA841C04C2 for ; Tue, 12 Jan 2016 12:27:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id D1CBC87406 for ; Tue, 12 Jan 2016 12:27:15 +0000 (UTC) Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QIJXR7qntTbh for ; Tue, 12 Jan 2016 12:27:14 +0000 (UTC) Received: from email.microchip.com (exsmtp01.microchip.com [198.175.253.37]) by hemlock.osuosl.org (Postfix) with ESMTPS id 78407873A8 for ; Tue, 12 Jan 2016 12:27:14 +0000 (UTC) Date: Tue, 12 Jan 2016 13:26:51 +0100 From: Christian Gromm Subject: Re: [PATCH 21/28] staging: most: fix retrieval of buffer availability Message-ID: <20160112132651.0b2ef332@muaddib> In-Reply-To: <20151224165713.GA26785@sudip-pc> References: <1450777989-5551-1-git-send-email-christian.gromm@microchip.com> <1450777989-5551-22-git-send-email-christian.gromm@microchip.com> <20151224165713.GA26785@sudip-pc> MIME-Version: 1.0 List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: Sudip Mukherjee Cc: gregkh@linuxfoundation.org, driverdev-devel@linuxdriverproject.org On Thu, 24 Dec 2015 22:27:13 +0530 Sudip Mukherjee wrote: > 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 > > --- > > > > > 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.. Right. I'll go ahead and post an update of this. Thanks, Chris > > regards > sudip _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel