[i2c] patch i2c-algo-bit-cleanups.patch added to gregkh-2.6 tree

gregkh at suse.de gregkh at suse.de
Wed Sep 6 23:54:27 CEST 2006


This is a note to let you know that I've just added the patch titled

     Subject: [PATCH 04/13] i2c-algo-bit: Cleanups

to my gregkh-2.6 tree.  Its filename is

     i2c-algo-bit-cleanups.patch

This tree can be found at 
    http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/


>From khali at linux-fr.org Sun Sep  3 13:22:17 2006
Date: Sun, 3 Sep 2006 22:22:12 +0200
From: Jean Delvare <khali at linux-fr.org>
To: Greg KH <greg at kroah.com>
Cc: Linux I2C <i2c at lm-sensors.org>
Subject: [PATCH 04/13] i2c-algo-bit: Cleanups
Message-Id: <20060903222212.0079900a.khali at linux-fr.org>
Content-Disposition: inline; filename=i2c-algo-bit-cleanups.patch

i2c-algo-bit: Cleanups

* Uninline long functions (saves around 1 kB or 15%)
* Refactor code in sclhi()
* Drop redundant udelay on repeated start

Signed-off-by: Jean Delvare <khali at linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>

---
 drivers/i2c/algos/i2c-algo-bit.c |   17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

--- gregkh-2.6.orig/drivers/i2c/algos/i2c-algo-bit.c
+++ gregkh-2.6/drivers/i2c/algos/i2c-algo-bit.c
@@ -76,17 +76,15 @@ static inline void scllo(struct i2c_algo
  * Raise scl line, and do checking for delays. This is necessary for slower
  * devices.
  */
-static inline int sclhi(struct i2c_algo_bit_data *adap)
+static int sclhi(struct i2c_algo_bit_data *adap)
 {
 	unsigned long start;
 
 	setscl(adap,1);
 
 	/* Not all adapters have scl sense line... */
-	if (adap->getscl == NULL ) {
-		udelay(adap->udelay);
-		return 0;
-	}
+	if (!adap->getscl)
+		goto done;
 
 	start=jiffies;
 	while (! getscl(adap) ) {	
@@ -101,6 +99,8 @@ static inline int sclhi(struct i2c_algo_
 		cond_resched();
 	}
 	DEBSTAT(printk(KERN_DEBUG "needed %ld jiffies\n", jiffies-start));
+
+done:
 	udelay(adap->udelay);
 	return 0;
 } 
@@ -121,7 +121,6 @@ static void i2c_repstart(struct i2c_algo
 	DEBPROTO(printk(" Sr "));
 	setsda(adap,1);
 	sclhi(adap);
-	udelay(adap->udelay);
 	
 	sdalo(adap);
 	scllo(adap);
@@ -306,7 +305,7 @@ bailout:
  * 0 chip did not answer
  * -x transmission error
  */
-static inline int try_address(struct i2c_adapter *i2c_adap,
+static int try_address(struct i2c_adapter *i2c_adap,
 		       unsigned char addr, int retries)
 {
 	struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
@@ -358,7 +357,7 @@ static int sendbytes(struct i2c_adapter 
 	return wrcount;
 }
 
-static inline int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
+static int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
 {
 	int inval;
 	int rdcount=0;   	/* counts bytes read */
@@ -408,7 +407,7 @@ static inline int readbytes(struct i2c_a
  * -x an error occurred (like: -EREMOTEIO if the device did not answer, or
  *	-ETIMEDOUT, for example if the lines are stuck...) 
  */
-static inline int bit_doAddress(struct i2c_adapter *i2c_adap, struct i2c_msg *msg) 
+static int bit_doAddress(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
 {
 	unsigned short flags = msg->flags;
 	unsigned short nak_ok = msg->flags & I2C_M_IGNORE_NAK;


Patches currently in gregkh-2.6 which might be from khali at linux-fr.org are

i2c/hwmon-w83627ehf-add-pwm-support.patch
i2c/hwmon-w83627ehf-documentation.patch
i2c/i2c-algo-bit-kill-mdelay.patch
i2c/hwmon-abituguru-suspend-resume.patch
i2c/i2c-__must_check-fixes-i2c-dev.patch
i2c/i2c-__must_check-fixes.patch
i2c/hwmon-it87-disabled-fans.patch
i2c/i2c-algo-sibyte-cleanups.patch
i2c/i2c-algo-sibyte-merge-in-i2c-sibyte.patch
i2c/i2c-au1550-add-au1200-support.patch
i2c/i2c-au1550-add-smbus-functionality-flag.patch
i2c/i2c-au1550-fix-timeout-problem.patch
i2c/i2c-bus-driver-for-TI-OMAP-boards.patch
i2c/i2c-isa-plan-for-removal.patch
i2c/i2c-dev-cleanups.patch
i2c/i2c-dev-convert-array-to-list.patch
i2c/i2c-dev-drop-template-client.patch
i2c/i2c-dev-device.patch
i2c/i2c-fix-copy-n-paste-in-subsystem-Kconfig.patch
i2c/i2c-matroxfb-c99-struct-init.patch
i2c/i2c-sibyte-drop-kip-walker-address.patch
i2c/i2c-stub-add-chip_addr-param.patch
i2c/hwmon-atxp1-signed-unsigned-char-bug.patch
i2c/hwmon-hdaps-handle-errors-from-input-register-device.patch
i2c/hwmon-it87-copyright-update.patch
i2c/hwmon-it87-div-to-reg-overflow.patch
i2c/hwmon-it87-in8-no-limits.patch
i2c/hwmon-it87-it8716f-support.patch
i2c/hwmon-it87-it8718f-support.patch
i2c/hwmon-it87-sane-limit-defaults.patch
i2c/hwmon-it87-set-fan-div.patch
i2c/hwmon-k8temp-autoload.patch
i2c/hwmon-k8temp-new-driver.patch
i2c/hwmon-smsc47m1-fix-dev-message.patch
i2c/i2c-algo-bit-cleanups.patch
i2c/i2c-algo-pcf-kill-mdelay.patch
i2c/i2c-algos-constify-i2c_algorithm.patch
i2c/i2c-busses-constify-i2c_algorithm.patch
i2c/i2c-chips-__must_check-fixes.patch
i2c/i2c-constify-i2c_algorithm.patch
i2c/i2c-dev-attach-detach-adapter-cleanups.patch
i2c/i2c-drop-slave-functions.patch
i2c/i2c-drop-useless-masking.patch
i2c/i2c-isa-restore-driver-owner.patch
i2c/i2c-isa-return-attach_adapter.patch
i2c/i2c-viapro-add-VT8251-VT8237A.patch
i2c/i2c-warn-on-failed-client-attach.patch



More information about the i2c mailing list