pc, pc64: replace atoi() calls with strtol() when hex can be expcte
This commit is contained in:
parent
1b7e120c09
commit
2ef29e10f4
3 changed files with 5 additions and 5 deletions
|
@ -261,8 +261,8 @@ mpoverride(uchar** newp, uchar** e)
|
||||||
uchar* p;
|
uchar* p;
|
||||||
char* s;
|
char* s;
|
||||||
|
|
||||||
size = atoi(getconf("*mp"));
|
size = strtol(getconf("*mp"), 0, 0);
|
||||||
if(size == 0) panic("mpoverride: invalid size in *mp");
|
if(size <= 0) panic("mpoverride: invalid size in *mp");
|
||||||
*newp = p = xalloc(size);
|
*newp = p = xalloc(size);
|
||||||
if(p == nil) panic("mpoverride: can't allocate memory");
|
if(p == nil) panic("mpoverride: can't allocate memory");
|
||||||
*e = p + size;
|
*e = p + size;
|
||||||
|
|
|
@ -864,7 +864,7 @@ i82365write(Chan *c, void *a, long n, vlong off)
|
||||||
|
|
||||||
/* set vpp on card */
|
/* set vpp on card */
|
||||||
if(strncmp(buf, "vpp", 3) == 0)
|
if(strncmp(buf, "vpp", 3) == 0)
|
||||||
wrreg(pp, Rpc, vcode(atoi(buf+3))|Fautopower|Foutena|Fcardena);
|
wrreg(pp, Rpc, vcode(strtol(buf+3, 0, 0))|Fautopower|Foutena|Fcardena);
|
||||||
return n;
|
return n;
|
||||||
case Qmem:
|
case Qmem:
|
||||||
case Qattr:
|
case Qattr:
|
||||||
|
|
|
@ -356,7 +356,7 @@ whichfw(Pcidev *p)
|
||||||
|
|
||||||
print("m10g: %d lanes; ecrc=%d; ", lanes, ecrc);
|
print("m10g: %d lanes; ecrc=%d; ", lanes, ecrc);
|
||||||
if(s = getconf("myriforce")){
|
if(s = getconf("myriforce")){
|
||||||
i = atoi(s);
|
i = strtol(s, 0, 0);
|
||||||
if(i != 4*KiB || i != 2*KiB)
|
if(i != 4*KiB || i != 2*KiB)
|
||||||
i = 2*KiB;
|
i = 2*KiB;
|
||||||
print("fw = %d [forced]\n", i);
|
print("fw = %d [forced]\n", i);
|
||||||
|
@ -390,7 +390,7 @@ parseeprom(Ctlr *c)
|
||||||
c->ra[k] = strtoul(s+j+3*k, 0, 16);
|
c->ra[k] = strtoul(s+j+3*k, 0, 16);
|
||||||
}else if(strncmp(s+i, "SN=", 3) == 0){
|
}else if(strncmp(s+i, "SN=", 3) == 0){
|
||||||
bits ^= 2;
|
bits ^= 2;
|
||||||
c->serial = atoi(s+i+3);
|
c->serial = strtoul(s+i+3, 0, 10);
|
||||||
}
|
}
|
||||||
i += l;
|
i += l;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue