search for: set_strap_from_fil

Displaying 3 results from an estimated 3 matches for "set_strap_from_fil".

Did you mean: set_strap_from_file
2014 Aug 25
0
[PATCH envytools] nvbios: Write missing null terminating byte.
...+797,9 @@ void find_strap(char *filename) { path = (char*) malloc(base_length + strlen(strap_filename)+1); strncpy(path, filename, base_length); - strncpy(path+base_length, strap_filename, strlen(strap_filename)); + strncpy(path+base_length, strap_filename, strlen(strap_filename)+1); - if(!set_strap_from_file(path)) + if (!set_strap_from_file(path)) printf("Strap register found in '%s'\n", path); free(path); -- 1.9.1
2014 Aug 31
6
[PATCH envytools] nvbios: Add missing null byte to string read from file.
--- nvbios/nvbios.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nvbios/nvbios.c b/nvbios/nvbios.c index f7aafe3..28e62ad 100644 --- a/nvbios/nvbios.c +++ b/nvbios/nvbios.c @@ -774,11 +774,12 @@ int set_strap_from_string(const char* strap_s) int set_strap_from_file(const char *path) { FILE *strapfile = NULL; - char tmp[21]; + char tmp[22]; strapfile = fopen(path, "r"); if (strapfile) { - fread(tmp, 1, 21, strapfile); + size_t size = fread(tmp, 1, 21, strapfile); + tmp[size] = 0; return set_strap_from_string(tmp); } -- 1.9.1
2014 Aug 25
12
[PATCH envytools] demmio: Add decoding of some MEM_TIMINGS registers for NVC0.
--- rnndb/memory/nvc0_pbfb.xml | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/rnndb/memory/nvc0_pbfb.xml b/rnndb/memory/nvc0_pbfb.xml index 500cea9..e006dbe 100644 --- a/rnndb/memory/nvc0_pbfb.xml +++ b/rnndb/memory/nvc0_pbfb.xml @@ -49,23 +49,54 @@ Most bitfields are unknown. </doc> <bitfield high="7"