commit c00e9e68d7f77cc3cf3475203860a66cafeba449:
Use already cached fp rather than constantly re-opening things on the fly.
breaks gpio operation.
It is possible to reuse the cached fp, but then we need to seek to the
beginning each time.
/sys/class/gpio/gpio*/value contains only one byte so without seek
we will get only one byte.

Signed-off-by: Frans Meulenbroeks <[email protected]>
---

The patch to use a cached fp = feek gave me about 1% performance gain.

 urjtag/src/tap/cable/gpio.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/urjtag/src/tap/cable/gpio.c b/urjtag/src/tap/cable/gpio.c
index 6e4c2c7..b380dba 100644
--- a/urjtag/src/tap/cable/gpio.c
+++ b/urjtag/src/tap/cable/gpio.c
@@ -132,6 +132,7 @@ static int gpio_get_value (FILE *fp, unsigned int gpio)
     int ret;
     int value;
 
+    fseek(fp, 0, 0);
     ret = fscanf (fp, "%i", &value);
 
     if (ret != 1)
-- 
1.7.0.4


------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to