[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6DB0273BA8@AcuExch.aculab.com>
Date: Mon, 30 Jan 2017 14:34:02 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Richard Cochran' <richardcochran@...il.com>,
Sudarsana Kalluru <Sudarsana.Kalluru@...ium.com>
CC: "davem@...emloft.net" <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"Yuval.Mintz@...ium.com" <Yuval.Mintz@...ium.com>
Subject: RE: [PATCH net-next v2 2/2] qede: Add driver support for PTP.
From: netdev-owner@...r.kernel.org [mailto:netdev-owner@...r.kernel.org] On Behalf Of Richard Cochran
> Sent: 29 January 2017 15:36
...
> > +static int qede_ptp_adjfreq(struct ptp_clock_info *info, s32 ppb)
> > +{
> > + struct qede_ptp *ptp = container_of(info, struct qede_ptp, clock_info);
> > + struct qede_dev *edev = ptp->edev;
> > + int rc;
> > +
> > + __qede_lock(edev);
> > + if (edev->state == QEDE_STATE_OPEN) {
> > + spin_lock_bh(&ptp->lock);
> > + rc = ptp->ops->adjfreq(edev->cdev, ppb);
>
> Why add this extra layer of indirection?
There might be two extra layers of indirection!
One can be removed by copying the function vector instead of referencing it.
So that call would be ptp->ops.adjfreq(...).
Even from the later emails I can't see which way around that call is.
How many different implementations of 'ops->adjfreq' are there?
If there is only one you don't need an indirect call.
David
Powered by blists - more mailing lists