lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Sun, 20 Nov 2016 20:37:20 +0100 From: Richard Cochran <richardcochran@...il.com> To: Andrei Pistirica <andrei.pistirica@...rochip.com> Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, davem@...emloft.net, nicolas.ferre@...el.com, harinikatakamlinux@...il.com, harini.katakam@...inx.com, punnaia@...inx.com, michals@...inx.com, anirudh@...inx.com, boris.brezillon@...e-electrons.com, alexandre.belloni@...e-electrons.com, tbultel@...elsurmer.com Subject: Re: [RFC PATCH v2 1/2] macb: Add 1588 support in Cadence GEM. On Fri, Nov 18, 2016 at 03:21:51PM +0100, Andrei Pistirica wrote: > +#ifdef CONFIG_MACB_USE_HWSTAMP > +void macb_ptp_init(struct net_device *ndev); > +#else > +void macb_ptp_init(struct net_device *ndev) { } static inline ^^^ > +#endif > +void macb_ptp_init(struct net_device *ndev) > +{ > + struct macb *bp = netdev_priv(ndev); > + struct timespec64 now; > + u32 rem = 0; > + > + if (!(bp->caps | MACB_CAPS_GEM_HAS_PTP)){ > + netdev_vdbg(bp->dev, "Platform does not support PTP!\n"); > + return; > + } You would have needed '&' and not '|' here. Also, using a flag limits the code to your platform. This works for you, but it is short sighted. The other MACB PTP blocks have different register layouts, and this patch does not lay the ground work for the others. The driver needs to be designed to support the other platforms. Thanks, Richard
Powered by blists - more mailing lists