From: Timur Tabi <timur@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] i2c: merge all i2c_reg_read() and i2c_reg_write() into inline functions
Date: Fri, 03 Oct 2008 18:25:09 -0500 [thread overview]
Message-ID: <48E6A9D5.4050307@freescale.com> (raw)
In-Reply-To: <20081003232136.76FA22480D@gemini.denx.de>
Wolfgang Denk wrote:
>> -void i2c_reg_write(uchar chip, uchar reg, uchar val)
>> -{
>> - PRINTD("i2c_reg_write: chip=0x%02x, reg=0x%02x, val=0x%02x\n", chip,
>> - reg, val);
>> - i2c_write(chip, reg, 0, &val, 1);
>> -}
>> -
>
> This does not exactly look identical to me.
The PRINTD is irrelevant. If these platforms really want to debug single I2C
operations, they can add the code back. It's just debug code, so I would think
that it's not worth sacrificing the improved code simplicity just for that.
> And when you claim "We can save space" - which sort of space are you
> talking about? Dos this reduce the memory footprint of the code?
I ran a couple tests, and u-boot.bin didn't change in size, but technically, it
should be smaller because the compiler will optimize the code into a normal call
to i2c_read or i2c_write.
Either way, at least the source code is smaller.
--
Timur Tabi
Linux kernel developer at Freescale
next prev parent reply other threads:[~2008-10-03 23:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-02 15:06 [U-Boot] [PATCH] i2c: merge all i2c_reg_read() and i2c_reg_write() into inline functions Timur Tabi
2008-10-03 22:25 ` Timur Tabi
2008-10-03 23:37 ` Wolfgang Denk
2008-10-03 23:21 ` Wolfgang Denk
2008-10-03 23:25 ` Timur Tabi [this message]
2008-10-03 23:39 ` Wolfgang Denk
2008-10-04 22:39 ` Timur Tabi
2008-10-05 16:06 ` Timur Tabi
2008-10-05 18:08 ` Stefan Roese
2008-10-06 3:25 ` Timur Tabi
2008-10-14 20:52 ` Wolfgang Denk
2008-10-14 21:00 ` Timur Tabi
2008-10-19 21:18 ` Mike Frysinger
2008-10-19 21:57 ` Timur Tabi
2008-10-19 23:41 ` Mike Frysinger
2008-10-20 14:19 ` Timur Tabi
2008-10-21 4:22 ` Mike Frysinger
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=48E6A9D5.4050307@freescale.com \
--to=timur@freescale.com \
--cc=u-boot@lists.denx.de \
/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