lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <50C07984.8000003@ti.com> Date: Thu, 6 Dec 2012 11:55:00 +0100 From: Peter Ujfalusi <peter.ujfalusi@...com> To: Grant Likely <grant.likely@...retlab.ca> CC: Linus Walleij <linus.walleij@...aro.org>, <linux-kernel@...r.kernel.org>, <linux-omap@...r.kernel.org> Subject: Re: [PATCH] gpio: twl4030: Correct status reporting when the GPIO is used as output On 12/05/2012 11:48 PM, Grant Likely wrote: >> - base = REG_GPIODATAIN1 + d_bnk; >> + direction = gpio_twl4030_read(REG_GPIODATADIR1 + d_bnk); >> + if (direction > 0 && (direction >> d_off) & 0x1) >> + base = REG_SETGPIODATAOUT1 + d_bnk; >> + else >> + base = REG_GPIODATAIN1 + d_bnk; >> + > > This is probably quite expensive considering that reads need to go out > the i2c bus. Things like the output state and the pin direction should > be cached by the driver in its private data structure so that you don't > add an additional i2c round trip. True. I have sent the v2, which grown a bit since I did not wanted to add more global variable to this driver. -- Péter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists