From: Corentin Labbe <clabbe.montjoie@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: peppe.cavallaro@st.com, alexandre.torgue@st.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/4] net-next: stmmac: rework the speed selection
Date: Tue, 23 May 2017 09:10:15 +0200 [thread overview]
Message-ID: <20170523071015.GA9279@Red> (raw)
In-Reply-To: <20170522.144944.1978795354564077830.davem@davemloft.net>
On Mon, May 22, 2017 at 02:49:44PM -0400, David Miller wrote:
> From: Corentin Labbe <clabbe.montjoie@gmail.com>
> Date: Mon, 22 May 2017 14:33:47 +0200
>
> > - mac->link.port = GMAC_CONTROL_PS;
> > mac->link.duplex = GMAC_CONTROL_DM;
> > - mac->link.speed = GMAC_CONTROL_FES;
> > + mac->link.speed10 = GMAC_CONTROL_PS;
> > + mac->link.speed100 = GMAC_CONTROL_PS | GMAC_CONTROL_FES;
> > + mac->link.speed1000 = 0;
> > + mac->link.speed_mask = GENMASK(15, 14);
>
> Neither GMAC_CONTROL_PS nor GMAC_CONTROL_FES are defined with
> the GENMASK() macro. So it is very confusing to see constant
> bit specifications here in C code.
>
> There are two ways to do this properly:
>
> 1) Use "(GMAC_CONTROL_PS | GMAC_CONTROL_FES)"
>
> 2) Define a new GMAC_CONTROL_SPDMASK to "GMAC_CONTROL_PS | GMAC_CONTROL_FES"
> and use that here.
>
Since dwmac100 use the #1, I will do the same on dwmac4/dwmac1000
Thanks.
prev parent reply other threads:[~2017-05-23 7:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-22 12:33 [PATCH v2 0/4] net-next: stmmac: rework the speed selection Corentin Labbe
2017-05-22 12:33 ` [PATCH v2 1/4] net-next: stmmac: Convert new_state to bool Corentin Labbe
2017-05-22 13:07 ` Joe Perches
2017-05-22 12:33 ` [PATCH v2 2/4] net-next: stmmac: Remove unnecessary parenthesis Corentin Labbe
2017-05-22 12:33 ` [PATCH v2 3/4] net-next: stmmac: use SPEED_xxx instead of raw value Corentin Labbe
2017-05-22 12:33 ` [PATCH v2 4/4] net-next: stmmac: rework the speed selection Corentin Labbe
2017-05-22 18:49 ` David Miller
2017-05-23 7:10 ` Corentin Labbe [this message]
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=20170523071015.GA9279@Red \
--to=clabbe.montjoie@gmail.com \
--cc=alexandre.torgue@st.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=peppe.cavallaro@st.com \
/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).