Re: [PATCH net-next] mdio: Export mdio.h to userland
flat view
From: David Miller <davem@davemloft.net>
Date: 2012-02-29 23:02:47
From: Ben Hutchings <redacted> Date: Wed, 29 Feb 2012 22:43:48 +0000
On Wed, 2012-02-29 at 15:42 -0500, David Miller wrote:quoted
From: Ben Hutchings <redacted> Date: Wed, 29 Feb 2012 19:12:34 +0000quoted
On Wed, 2012-02-29 at 19:02 +0000, Ben Hutchings wrote:quoted
The ID packing/unpacking functions are needed by userland and the register definitions may also be useful there.Minor issue with this: mdio_phy_id_is_c45() returns bool, and that's not defined by default. Should I add #include <stdbool.h> or change the return type to int for maximum compatibility?I do not see any precedence for including stdbool.h in a kernel header file. And I sure as hell am not going to compromise using a correct type just to make this usable by userspace. I think this is of dubious value, and combined with the bool complication I'm not going to apply this, sorry.Without this, userland doing clause 45 MDIO has to duplicate the ID packing definitions.
Then come up with a real solution to the bool issue. But note that changing the bool to an int is not a solution, neither is #include <stdbool.h> unless we can reach consensus on lkml that this is OK.