Christian Costa
2014-Aug-31 13:00 UTC
[Nouveau] [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
Christian Costa
2014-Aug-31 13:00 UTC
[Nouveau] [PATCH envytools] nva: Add nvaforcetemp to git ignore and sort it for better update
--- nva/.gitignore | 53 +++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/nva/.gitignore b/nva/.gitignore index 5c9184b..72de056 100644 --- a/nva/.gitignore +++ b/nva/.gitignore @@ -1,39 +1,40 @@ +evotiming +libnva.a +libnva.so +nv01dump +nv01post +nvacounter +nvadownload +nvaevo +nvafakebios nvafill +nvaforcetemp +nvafucstart +nvafuzz +nvagetbios +nvagetpmu nvahammer nvalist +nvamemtiming +nvammiotracereplay nvapeek +nvapeeki nvapeekstat +nvapms nvapoke -nvapeeki -nvagetbios -nvafakebios +nvapy.c +nvapy.so nvascan +nvaspyi2c +nvastrscan nvatiming -nvapms -nvafuzz +nvaupload +nvavucstart nvawatch -nvacounter -nvastrscan -nvaevo -nvaxttime -nvaxtstart +nvaxtinsn nvaxtpeek nvaxtpoke nvaxtrsr nvaxtssr -nvaxtinsn -nvaupload -nvadownload -evotiming -nvavucstart -nvafucstart -nvamemtiming -nv01post -nv01dump -nvammiotracereplay -nvaspyi2c -libnva.a -libnva.so -nvapy.c -nvapy.so -nvagetpmu +nvaxtstart +nvaxttime -- 1.9.1
Christian Costa
2014-Aug-31 13:00 UTC
[Nouveau] [PATCH envytools] nvamemtiming: Update usage.
--- nva/nvamemtiming.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nva/nvamemtiming.c b/nva/nvamemtiming.c index 4468f81..75c6e49 100644 --- a/nva/nvamemtiming.c +++ b/nva/nvamemtiming.c @@ -51,6 +51,8 @@ void usage(int argc, char **argv) fprintf(stderr, "\t-e: Only modify the specified index (to be used with -v)\n"); fprintf(stderr, "\t-v: Set the specified value to the specified entry\n"); fprintf(stderr, "\t-b index: Consider the specified index as a bitfield and RE it\n"); + fprintf(stderr, "\t-s index: Specify range start in timing entry (Deep & Shallow modes)\n"); + fprintf(stderr, "\t-f index: Specify range end in timing entry (Deep & Shallow modes)\n"); fprintf(stderr, "\t-d timing_entry_high: For each indexes, iterate between the timing_entry and the timing_entry_high value (Deep mode)\n"); exit(-1); } -- 1.9.1
Christian Costa
2014-Aug-31 13:00 UTC
[Nouveau] [PATCH envytools] nvamemtiming: Handle target < initial case when iterating values
Otherwise some values are not tested at all.
---
nva/set_timings.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/nva/set_timings.c b/nva/set_timings.c
index 6cd831c..7a8f845 100644
--- a/nva/set_timings.c
+++ b/nva/set_timings.c
@@ -408,7 +408,7 @@ static void
iterate_values(struct nvamemtiming_conf *conf, FILE *outf, uint8_t index, enum
color color)
{
uint8_t initial, target;
- int v;
+ int v, incr;
if (conf->mode != MODE_DEEP)
return;
@@ -416,7 +416,8 @@ iterate_values(struct nvamemtiming_conf *conf, FILE *outf,
uint8_t index, enum c
initial = conf->vbios.data[conf->vbios.timing_entry_offset + index];
target = conf->vbios.data[conf->deep.timing_entry_offset + index];
- for (v = initial+1; v <= target; v++) {
+ incr = target > initial ? 1 : -1;
+ for (v = initial+incr; v != target+incr; v+=incr) {
conf->vbios.data[conf->vbios.timing_entry_offset + index] = v;
launch(conf, outf, index + 1 , COLOR);
}
--
1.9.1
Martin Peres
2014-Aug-31 13:12 UTC
[Nouveau] [PATCH envytools] nvamemtiming: Handle target < initial case when iterating values
On 31/08/2014 15:00, Christian Costa wrote:> Otherwise some values are not tested at all.I would rather have a warning than the program doing stuff behind my back. This is a dev tool, dumb == good ;)
Martin Peres
2014-Aug-31 13:13 UTC
[Nouveau] [PATCH envytools] nva: Add nvaforcetemp to git ignore and sort it for better update
Woops, my bad... Sorry!
Martin Peres
2014-Aug-31 13:16 UTC
[Nouveau] [PATCH envytools] nvbios: Add missing null byte to string read from file.
On 31/08/2014 15:00, Christian Costa wrote:> --- > 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); > } >Thanks, I pushed the first 3 patches!
Maybe Matching Threads
- [PATCH envytools] nvbios: Add missing null byte to string read from file.
- [PATCH envytools] Fix range end to the last value of timing table.
- [PATCH envytools] Fix range end to the last value of timing table.
- [PATCH envytools] nvbios: Fix reading of ram_restrict_group_count.
- [PATCH envytools] nva: Add nvaforcetemp to git ignore and sort it for better update