Re: [PATCH BlueZ 1/2] a2dp: Store last used endpoint

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

 



Hi Pali,

On Wed, Apr 24, 2019 at 8:01 PM Pali Rohár <pali.rohar@xxxxxxxxx> wrote:
>
> On Wednesday 24 April 2019 12:42:22 Luiz Augusto von Dentz wrote:
> > On Wed, Apr 24, 2019 at 11:39 AM Luiz Augusto von Dentz
> > > @@ -2355,8 +2421,12 @@ done:
> > >  static struct a2dp_sep *a2dp_find_sep(struct avdtp *session, GSList *list,
> > >                                         const char *sender)
> > >  {
> > > +       struct a2dp_sep *first = NULL;
> > > +       struct a2dp_channel *chan = find_channel(session);
> > > +
> > >         for (; list; list = list->next) {
> > >                 struct a2dp_sep *sep = list->data;
> > > +               struct avdtp_remote_sep *rsep;
> > >
> > >                 /* Use sender's endpoint if available */
> > >                 if (sender) {
> > > @@ -2370,14 +2440,22 @@ static struct a2dp_sep *a2dp_find_sep(struct avdtp *session, GSList *list,
> > >                                 continue;
> > >                 }
> > >
> > > -               if (avdtp_find_remote_sep(session, sep->lsep) == NULL)
> > > +               rsep = avdtp_find_remote_sep(session, sep->lsep);
> > > +               if (!rsep)
> > >                         continue;
> > >
> > > +               /* Locate last used if set */
> > > +               if (chan->last_used) {
> > > +                       if (chan->last_used->sep == rsep)
> > > +                               return sep;
> > > +                       first = sep;
>
> This assignment is useless as 2 lines below you are returning sep from
> function. So assignment of sep into first does nothing.

Right, there was supposed to be a continue at this point.

> > > +               }
> > > +
> > >                 return sep;
> > >
> > >         }
> > >
> > > -       return NULL;
> > > +       return first;
> > >  }
> > >
> > >  static struct a2dp_sep *a2dp_select_sep(struct avdtp *session, uint8_t type,
>
> --
> Pali Rohár
> pali.rohar@xxxxxxxxx



-- 
Luiz Augusto von Dentz




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux