From: Ben Hutchings <bhutchings@solarflare.com>
To: Stuart Hodgson <smhodgson@solarflare.com>
Cc: <netdev@vger.kernel.org>, <bruce.w.allan@intel.com>,
<mirq-linux@rere.qmqm.pl>, <decot@google.com>,
<amit.salecha@qlogic.com>, <alexander.h.duyck@intel.com>,
<davem@davemloft.net>, <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 1/2] net: ethtool: Add capability to retrieve plug-in module EEPROM
Date: Mon, 2 Apr 2012 19:14:38 +0100 [thread overview]
Message-ID: <1333390478.2623.44.camel@bwh-desktop.uk.solarflarecom.com> (raw)
In-Reply-To: <1333389160.2623.30.camel@bwh-desktop.uk.solarflarecom.com>
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.
next prev parent reply other threads:[~2012-04-02 18:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-27 17:51 Stuart Hodgson
2012-04-02 17:52 ` Ben Hutchings
2012-04-02 18:14 ` Ben Hutchings [this message]
2012-04-11 16:50 ` Stuart Hodgson
2012-04-11 18:16 ` Ben Hutchings
2012-04-11 23:42 ` Ben Hutchings
2012-04-12 9:18 ` Stuart Hodgson
2012-04-12 18:41 ` Ben Hutchings
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1333390478.2623.44.camel@bwh-desktop.uk.solarflarecom.com \
--to=bhutchings@solarflare.com \
--cc=alexander.h.duyck@intel.com \
--cc=amit.salecha@qlogic.com \
--cc=bruce.w.allan@intel.com \
--cc=davem@davemloft.net \
--cc=decot@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mirq-linux@rere.qmqm.pl \
--cc=netdev@vger.kernel.org \
--cc=smhodgson@solarflare.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®