[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <02874ECE860811409154E81DA85FBB5884D0FDF4@ORSMSX115.amr.corp.intel.com>
Date: Wed, 31 Oct 2018 16:56:36 +0000
From: "Keller, Jacob E" <jacob.e.keller@...el.com>
To: Miroslav Lichvar <mlichvar@...hat.com>,
Richard Cochran <richardcochran@...il.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>
Subject: RE: [RFC PATCH 3/4] igb: add support for extended PHC gettime
> -----Original Message-----
> From: Miroslav Lichvar [mailto:mlichvar@...hat.com]
> Sent: Wednesday, October 31, 2018 2:40 AM
> To: Richard Cochran <richardcochran@...il.com>
> Cc: netdev@...r.kernel.org; intel-wired-lan@...ts.osuosl.org; Keller, Jacob E
> <jacob.e.keller@...el.com>
> Subject: Re: [RFC PATCH 3/4] igb: add support for extended PHC gettime
>
> On Tue, Oct 30, 2018 at 07:29:16PM -0700, Richard Cochran wrote:
> > On Fri, Oct 26, 2018 at 06:27:41PM +0200, Miroslav Lichvar wrote:
> > > +static int igb_ptp_gettimex(struct ptp_clock_info *ptp,
> > > + struct ptp_system_timestamp *sts)
> > > +{
> > > + struct igb_adapter *igb = container_of(ptp, struct igb_adapter,
> > > + ptp_caps);
> > > + struct e1000_hw *hw = &igb->hw;
> > > + unsigned long flags;
> > > + u32 lo, hi;
> > > + u64 ns;
> > > +
> > > + spin_lock_irqsave(&igb->tmreg_lock, flags);
> > > +
> > > + /* 82576 doesn't have SYSTIMR */
> > > + if (igb->hw.mac.type == e1000_82576) {
> >
> > Instead of if/then/else, can't you follow the pattern of providing
> > different function flavors ...
>
> I can. I was just trying to minimize the amount of triplicated code.
> In the next version I'll add a patch to deprecate the old gettime
> functions, as Jacob suggested, and replace them with the extended
> versions, so the amount of code will not change that much.
>
Excellent.
-Jake
> Thanks,
>
> --
> Miroslav Lichvar
Powered by blists - more mailing lists