[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180209210459.GC2079@lunn.ch>
Date: Fri, 9 Feb 2018 22:04:59 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Richard Cochran <richardcochran@...il.com>
Cc: netdev <netdev@...r.kernel.org>,
Florian Fainelli <f.fainelli@...il.com>,
Vivien Didelot <vivien.didelot@...oirfairelinux.com>,
sean.wang@...iatek.com, Woojung.Huh@...rochip.com,
john@...ozen.org, jbe@...gutronix.de,
Brandon Streiff <brandon.streiff@...com>
Subject: Re: [RFC PATCH 04/10] net: dsa: mv88e6xxx: expose switch time as a
PTP hardware clock
On Fri, Feb 09, 2018 at 12:33:36PM -0800, Richard Cochran wrote:
> On Sat, Feb 03, 2018 at 10:40:08PM +0100, Andrew Lunn wrote:
> > +static int mv88e6xxx_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
> > +{
> > + struct mv88e6xxx_chip *chip = ptp_to_chip(ptp);
> > + int neg_adj = 0;
> > + u32 diff, mult;
> > + u64 adj;
> > +
> > + if (scaled_ppm < 0) {
> > + neg_adj = 1;
> > + scaled_ppm = -scaled_ppm;
> > + }
> > + mult = CC_MULT;
> > + adj = scaled_ppm * CC_MULT_NUM;
> ^^^^^^^^^^^^^^^^^^^^^^^^
> This easily overflows on 32 bit platforms. My bad. Fix below...
Hi Richard
Thanks, i will squash the fix in for the next version.
Andrew
Powered by blists - more mailing lists