From: khali@linux-fr.org (Jean Delvare)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/1] fix i2c_msg.len not aligning with i2c_master_send
Date: Thu, 4 Feb 2010 14:14:51 +0100 [thread overview]
Message-ID: <20100204141451.3e0f865e@hyperion.delvare> (raw)
In-Reply-To: <f17812d71002040447y4b6f889o1137ae6149559994@mail.gmail.com>
On Thu, 4 Feb 2010 04:47:41 -0800, Eric Miao wrote:
> > How about return error in i2c_master_send & i2c_master_recv when count
> > is bigger than 64K, as suggested by Ben.
>
> I think that's more preferable. Making the count parameter as u16,
> though is going to generate a warning, yet that's usually ignored
> by careless programmer, screaming out when this happens might
> be more useful sometimes.
Developers ignoring warnings get the pain the deserve.
A check on "count" would come at the price of a small performance hit
for every caller, even though in 99% of the cases the check isn't
needed.
That being said I don't care too much and will take whatever patch is
sent to me.
It would be a good idea to add a note about this limit in
Documentation/i2c/writing-clients and/or include/linux/i2c.h.
> > The device I used could receive 32K one time instead, the firmware
> > download only takes place on-demand in fact.
> > However, it took some time to debug, since no error info come out.
> > Add error msg may notify users, though transfering more than 64K data
> > one time is rarely happen.
--
Jean Delvare
next prev parent reply other threads:[~2010-02-04 13:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-04 6:04 [PATCH 1/1] fix i2c_msg.len not aligning with i2c_master_send zhangfei gao
2010-02-04 7:37 ` Ben Dooks
2010-02-04 8:25 ` zhangfei gao
2010-02-04 9:35 ` Jean Delvare
2010-02-04 12:38 ` zhangfei gao
2010-02-04 12:47 ` Eric Miao
2010-02-04 13:14 ` Jean Delvare [this message]
2010-02-05 5:51 ` zhangfei gao
2010-02-05 11:12 ` Eric Miao
2010-02-21 11:20 ` Jean Delvare
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=20100204141451.3e0f865e@hyperion.delvare \
--to=khali@linux-fr.org \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).