Hi,

checking some patches thru www.kernel.org
I noticed in

/drivers/net/igb/e1000_mbx.c

in function

static s32 igb_poll_for_msg(struct e1000_hw *hw, u16 mbx_id)
{
       struct e1000_mbx_info *mbx = &hw->mbx;
       int countdown = mbx->timeout;

       if (!mbx->ops.check_for_msg)
               goto out;

       while (mbx->ops.check_for_msg(hw, mbx_id)) {
               if (!countdown)
                       break;
               countdown--;
               udelay(mbx->usec_delay);
       }
out:
       return countdown ? 0 : -E1000_ERR_MBX;
}

that when while loop has been executed
mbx->timeout times, countdown is now 0
and last while test (mbx->ops.check_for_msg(hw, mbx_id)) is done. Regardles of 
the test result, -E1000_ERR_MBX is returned
from the function, because contdown is 0.
Should 0 be returned if the last possible (after mbx->timeout udelays) 
mbx->ops.check_for_msg(hw, mbx_id) is a success?
What if mbx->timeout is 0, should mbx->ops.check_for_msg(hw, mbx_id) result be 
honoured? Or might mbx->timeout == 0
be a special case, returning -E1000_ERR_MBX anyway?

Same situation in function

static s32 igb_poll_for_ack(struct e1000_hw *hw, u16 mbx_id)

If you reply to this message,
please put the Subject of your reply as "Timeout",
or my spam filter will eat your reply.

Reported-by: "Juha Leppanen" <juha_motorsport...@luukku.com>
tag would be nice in kernel.org :)
Not so many kernel hackers give credit these days :(

Happy hacking,

Mr. Juha Leppanen
Kuopio, Finland


...................................................................
Luukku Plus paketilla pääset eroon tila- ja turvallisuusongelmista.
Hanki Luukku Plus ja helpotat elämääsi. http://www.mtv3.fi/luukku

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel

Reply via email to