Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1643116

Re: [PATCH 1/2] net-next: stmmac: add adjust_link function

From Corentin Labbe <clabbe.montjoie@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] net-next: stmmac: add adjust_link function
Date 2017-05-17 10:30 +0200
Message-ID <tI2vf-DW-9@gated-at.bofh.it> (permalink)
References <tHmFH-7ES-1@gated-at.bofh.it> <tHNPA-7Zs-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, May 16, 2017 at 09:43:04AM -0700, Florian Fainelli wrote:
> On 05/15/2017 04:41 AM, Corentin Labbe wrote:
> > My dwmac-sun8i serie will add some if (has_sun8i) to
> > stmmac_adjust_link()
> > Since the current stmmac_adjust_link() alreaady have lots of if (has_gmac/gmac4),
> > It is now better to create an adjust_link() function for each dwmac.
> 
> Is it really, because the diffstat really seems to indicate otherwise
> and by looking at the code, I am definitively not convinced this is an
> improvement other the current code.
> 
> > 
> > So this patch add an adjust_link() function pointer, and move code out
> > of stmmac_adjust_link to it.
> 
> Can't we keep the existing adjust_link() function and just have a
> different one for dwmac-sun8i that either re-uses portions of the
> existing, or duplicate just what it needs?
> 

I found another way, removing port/speed variable and use new struct links member speed10/speed100/speed1000/speedmask 
I will make the current adjust_link function simplier. (and no if has_xxx for any dwmac type)

I will send that try soon.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] net-next: stmmac: add adjust_link function Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-05-15 13:50 +0200
  [PATCH 2/2] net-next: stmmac: remove struct mac_link Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-05-15 13:50 +0200
  Re: [PATCH 1/2] net-next: stmmac: add adjust_link function David Miller <davem@davemloft.net> - 2017-05-16 18:40 +0200
  Re: [PATCH 1/2] net-next: stmmac: add adjust_link function Florian Fainelli <f.fainelli@gmail.com> - 2017-05-16 18:50 +0200
    Re: [PATCH 1/2] net-next: stmmac: add adjust_link function Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-05-16 21:10 +0200
    Re: [PATCH 1/2] net-next: stmmac: add adjust_link function Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-05-17 10:30 +0200

csiph-web