From: Ben Hutchings <bhutchings@solarflare.com>
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-net-drivers@solarflare.com>
Subject: Re: [PATCH net-next] mdio: Export mdio.h to userland
Date: Wed, 29 Feb 2012 23:09:52 +0000 [thread overview]
Message-ID: <1330556992.5881.11.camel@bwh-desktop> (raw)
In-Reply-To: <20120229.180242.197576747542301377.davem@davemloft.net>
On Wed, 2012-02-29 at 18:02 -0500, David Miller wrote:
> From: Ben Hutchings <bhutchings@solarflare.com>
> Date: Wed, 29 Feb 2012 22:43:48 +0000
>
> > On Wed, 2012-02-29 at 15:42 -0500, David Miller wrote:
> >> From: Ben Hutchings <bhutchings@solarflare.com>
> >> Date: Wed, 29 Feb 2012 19:12:34 +0000
> >>
> >> > On Wed, 2012-02-29 at 19:02 +0000, Ben Hutchings wrote:
> >> >> 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.
I could just move the mdio_phy_id_is_c45(), mdio_phy_id_prtad(),
mdio_phy_id_devad() functions inside #ifdef __KERNEL__ since userland
shouldn't need to unpack PHY IDs.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
next prev parent reply other threads:[~2012-02-29 23:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-29 19:02 [PATCH net-next] mdio: Export mdio.h to userland Ben Hutchings
2012-02-29 19:12 ` Ben Hutchings
2012-02-29 20:42 ` David Miller
2012-02-29 22:43 ` Ben Hutchings
2012-02-29 23:02 ` David Miller
2012-02-29 23:09 ` Ben Hutchings [this message]
2012-02-29 23:31 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1330556992.5881.11.camel@bwh-desktop \
--to=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=linux-net-drivers@solarflare.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).