lkml.org 
[lkml]   [2012]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 1/2] net: ethtool: Add capability to retrieve plug-in module EEPROM
From
Date
On Mon, 2012-04-02 at 18:52 +0100, Ben Hutchings wrote:
[...]
> > + ret = ops->get_module_eeprom(dev, &eeprom, data);
> > + if (ret)
> > + goto out;
> > +
> > +
> > + if (copy_to_user(userbuf, data, eeprom.len)) {
> > + ret = -EFAULT;
> > + goto out;
> > + }
> > +
> > + if (copy_to_user(useraddr, &eeprom, sizeof(eeprom)))
> > + ret = -EFAULT;
> [...]
>
> I think you can drop this last copy as there's no information to return
> in the eeprom structure itself.
[...]

This is not the case because we need to cover short reads.

Ben.

--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.



\
 
 \ /
  Last update: 2012-04-02 20:17    [from the cache]
©2003-2011 Jasper Spaans