[PATCH 16/20] e1000: Add functions for register polling

Sascha Hauer s.hauer at pengutronix.de
Tue Jan 19 23:32:18 PST 2016


On Tue, Jan 19, 2016 at 10:53:07AM -0800, Andrey Smirnov wrote:
> On Tue, Jan 19, 2016 at 12:21 AM, Sascha Hauer <s.hauer at pengutronix.de> wrote:
> > On Sun, Jan 17, 2016 at 07:52:37PM -0800, Andrey Smirnov wrote:
> >> Signed-off-by: Andrey Smirnov <andrew.smirnov at gmail.com>
> >> ---
> >>  drivers/net/e1000/e1000.h | 19 +++++++++++++++++++
> >>  1 file changed, 19 insertions(+)
> >>
> >> diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
> >> index 291e64d..5e24758 100644
> >> --- a/drivers/net/e1000/e1000.h
> >> +++ b/drivers/net/e1000/e1000.h
> >> @@ -2176,5 +2176,24 @@ static inline uint32_t e1000_read_reg(struct e1000_hw *hw, uint32_t reg)
> >>  }
> >>
> >>
> >> +static inline int e1000_poll_reg(struct e1000_hw *hw, uint32_t reg,
> >> +                              uint32_t mask, uint32_t value,
> >> +                              uint64_t timeout)
> >
> > We should let the compiler decide whether to inline this or not. Can we
> > remove the inline?
> 
> In general the reason I put "inline" when defining functions in
> headers -- that is not to say that it applies in this case -- is
> because that tells the compiler that the code for function doesn't
> have to put in the object file if no one is using it. Otherwise when
> .c that doesn't reference includes .h with static non-inline function
> that nobody uses GCC might emit a warning about unused function.

I didn't realize this function is in the header file. Can we put it in
the C file?

> 
> I'd love to do that. How do you feel about getting rid of
> E1000_READ_REG and E1000_WRITE_REG?

Good idea. I'm all in for that.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list