summaryrefslogtreecommitdiff
path: root/sys/src
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-12-16 09:41:05 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2014-12-16 09:41:05 +0100
commit0e03a5f9fd033eb1f3defe58d799ec7e1dba564a (patch)
treee2c35a2078d528e65562e67e9db5a85a5e46eb3d /sys/src
parent5c29603f502d83955f87be7385e0323a43e1ee2c (diff)
kernel: replace ulong with uintptr in ucallocb() and fix unneeded parentheses
Diffstat (limited to 'sys/src')
-rw-r--r--sys/src/9/port/allocb.c10
-rw-r--r--sys/src/9/port/ucallocb.c14
2 files changed, 12 insertions, 12 deletions
diff --git a/sys/src/9/port/allocb.c b/sys/src/9/port/allocb.c
index 816dab837..00af00e4d 100644
--- a/sys/src/9/port/allocb.c
+++ b/sys/src/9/port/allocb.c
@@ -28,7 +28,7 @@ _allocb(int size)
b->next = nil;
b->list = nil;
- b->free = 0;
+ b->free = nil;
b->flag = 0;
/* align start of data portion by rounding up */
@@ -37,9 +37,9 @@ _allocb(int size)
b->base = (uchar*)addr;
/* align end of data portion by rounding down */
- b->lim = ((uchar*)b) + msize(b);
- addr = (uintptr)(b->lim);
- addr = addr & ~(BLOCKALIGN-1);
+ b->lim = (uchar*)b + msize(b);
+ addr = (uintptr)b->lim;
+ addr &= ~(BLOCKALIGN-1);
b->lim = (uchar*)addr;
/* leave sluff at beginning for added headers */
@@ -129,7 +129,7 @@ freeb(Block *b)
* drivers which perform non cache coherent DMA manage their own buffer
* pool of uncached buffers and provide their own free routine.
*/
- if(b->free) {
+ if(b->free != nil) {
b->free(b);
return;
}
diff --git a/sys/src/9/port/ucallocb.c b/sys/src/9/port/ucallocb.c
index 93a07d336..126733d9a 100644
--- a/sys/src/9/port/ucallocb.c
+++ b/sys/src/9/port/ucallocb.c
@@ -24,25 +24,25 @@ static Block*
_ucallocb(int size)
{
Block *b;
- ulong addr;
+ uintptr addr;
if((b = ucalloc(sizeof(Block)+size+Hdrspc)) == nil)
return nil;
b->next = nil;
b->list = nil;
- b->free = 0;
+ b->free = nil;
b->flag = 0;
/* align start of data portion by rounding up */
- addr = (ulong)b;
+ addr = (uintptr)b;
addr = ROUND(addr + sizeof(Block), BLOCKALIGN);
b->base = (uchar*)addr;
/* align end of data portion by rounding down */
- b->lim = ((uchar*)b) + msize(b);
- addr = (ulong)(b->lim);
- addr = addr & ~(BLOCKALIGN-1);
+ b->lim = (uchar*)b + msize(b);
+ addr = (uintptr)b->lim;
+ addr &= ~(BLOCKALIGN-1);
b->lim = (uchar*)addr;
/* leave sluff at beginning for added headers */
@@ -123,7 +123,7 @@ ucfreeb(Block *b)
* drivers which perform non cache coherent DMA manage their own buffer
* pool of uncached buffers and provide their own free routine.
*/
- if(b->free) {
+ if(b->free != nil) {
b->free(b);
return;
}