Re: Re: [PATCH V4 net-bugfixs] net/ethernet: Update ret when ptp_clock is ERROR

From: Richard Cochran
Date: Sat Nov 14 2020 - 10:15:11 EST


On Fri, Nov 13, 2020 at 05:21:43PM +0100, Arnd Bergmann wrote:
> I've prototyped a patch that I think makes this more sensible
> again: https://pastebin.com/AQ5nWS9e

I like the behavior described in the text.

Instead of this ...

- if a built-in driver calls PTP interface functions but fails
to select HAVE_PTP_1588_CLOCK or depend on PTP_1588_CLOCK,
and PTP support is a loadable module, we get a link error
instead of having an unusable clock.

how about simply deleting the #else clause of

--- a/include/linux/ptp_clock_kernel.h
+++ b/include/linux/ptp_clock_kernel.h
@@ -173,7 +173,7 @@ struct ptp_clock_event {
};
};

-#if IS_REACHABLE(CONFIG_PTP_1588_CLOCK)
+#if IS_ENABLED(CONFIG_PTP_1588_CLOCK)

so that invalid configurations throw a compile time error instead?

Thanks,
Richard