linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Eric Miao <eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: zhangfei gao
	<zhangfei.gao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	haojian.zhuang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Linux I2C <linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [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-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

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

  parent reply	other threads:[~2010-02-04 13:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <309424b61002032204y37307236q94ab3a502b0526e0@mail.gmail.com>
     [not found] ` <20100204073759.GC13267@trinity.fluff.org>
     [not found]   ` <20100204073759.GC13267-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org>
2010-02-04  8:25     ` [PATCH 1/1] fix i2c_msg.len not aligning with i2c_master_send zhangfei gao
     [not found] ` <309424b61002032204y37307236q94ab3a502b0526e0-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-04  9:35   ` Jean Delvare
2010-02-04 12:38     ` zhangfei gao
2010-02-04 12:47       ` Eric Miao
     [not found]         ` <f17812d71002040447y4b6f889o1137ae6149559994-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-04 13:14           ` Jean Delvare [this message]
     [not found]             ` <20100204141451.3e0f865e-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-02-05  5:51               ` zhangfei gao
     [not found]                 ` <309424b61002042151i2a762d41md3521a820fd45622-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
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-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=haojian.zhuang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=zhangfei.gao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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).