Re: [PATCH] SMSC LAN9500 USB2.0 10/100 ethernet adapter driver

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Masakazu Mokuno
Date: Monday, September 8, 2008 - 3:52 am

Hi,

My comments inlined. 

On Fri,  5 Sep 2008 11:51:30 +0100
Steve Glendinning <steve.glendinning@smsc.com> wrote:

                               ^ 
TAB inserted?


Most users of this function pass the pointer of their local variables
for 'data'.   So we may want to define the last parameter just as 'u32'
instead of 'u32 *'.  I think it would help the compiler to generate
better codes.


Needs kfree(buf)


phy_id &= dev->mii.phy_id_mask;
idx &= dev->mii.id_num_mask;

Or we may want to #define the masks and use them here and in
smsc95xx_phy_initialize().

Also note that generic_mii_ioctl() does this as well.  But I'm not sure
if there are any other paths which call these mii callbacks directly


ditto

As smsc95xx_read_reg() uses the synchronous urb call and AFAIR ehci
would defer the interrupts until 8 micro-frames by default, so I guess this
loop would take more than 40ms?


Please see the comment in smsc95xx_ethtool_get_eeprom().


smsc95xx_eeprom_is_busy() would wait for 40ms.  You wait for 4ms here. Is
it enough?


Please see the comment smsc95xx_read_eeprom()


ditto


I think kfree(usb_context) is better.


smsc95xx_read_reg() uses 'if (!buf)' style for NULL check. We may want
to do in the consistent way?


There seems to be no callers which set the 'wait' parameter.  Could we
eliminate this 'if' statement and the 'wait' parameter?


For the case when usb_submit_urb() returns error, we should:

	return status;




We can go through the reset of this function even if smsc95xx_read_reg()
returns an error?  Is there no case that smsc95xx_read_reg() sets the
garbage to afc_cfg?


u32 intdata;


The real user for 'intdata' here is only SMSC_TRACE().  So if USE_DEBUG
is undefined, 'intdata' will not be needed.


Need to read again?  Just for SMSC_TRACE()?


This boundary check is already done in ethtool_get_eeprom().


This boundary check is already done in ethtool_set_eeprom().


return -EINVAL?

                                       ^^
out?


#ifndef _SMSC95XX_H
#define _SMSC95XX_H


-- 
Masakazu Mokuno

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] SMSC LAN9500 USB2.0 10/100 ethernet adapter driver, Steve Glendinning, (Fri Sep 5, 3:51 am)
Re: [PATCH] SMSC LAN9500 USB2.0 10/100 ethernet adapter driver, Masakazu Mokuno, (Mon Sep 8, 3:52 am)