Re: [PATCH 3/5] kern: eliminate unused assignment

2013-11-10 Thread Marin Ramesa
On 10.11.2013 23:24:42, Justus Winter wrote: > Quoting Samuel Thibault (2013-11-10 23:04:28) > > Marin Ramesa, le Sun 10 Nov 2013 22:50:22 +0100, a écrit : > > > Value of result is never read. Eliminate the unused assignment. > > > > > > * kern/elf-load.c: Eliminate unused assignment. > > > > Jus

Re: [PATCH 3/5] kern: eliminate unused assignment

2013-11-10 Thread Justus Winter
Quoting Samuel Thibault (2013-11-10 23:04:28) > Marin Ramesa, le Sun 10 Nov 2013 22:50:22 +0100, a écrit : > > Value of result is never read. Eliminate the unused assignment. > > > > * kern/elf-load.c: Eliminate unused assignment. > > Justus has an ACKed better patch which propagates the result,

Re: [PATCH 5/5] vm: remove unused assignment

2013-11-10 Thread Samuel Thibault
Marin Ramesa, le Sun 10 Nov 2013 22:50:24 +0100, a écrit : > Value of src_size is never read. Remove unused assignment. Same here, I'd rather keep it. > * vm/vm_map.c: Remove unused assignment. > > --- > vm/vm_map.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/vm/vm

Re: [PATCH 4/5] vm: remove duplicate assignment

2013-11-10 Thread Samuel Thibault
Marin Ramesa, le Sun 10 Nov 2013 22:50:23 +0100, a écrit : > * vm/vm_fault.c: Remove duplicate assignment. I'd rather keep it, the assignment makes sense, even if not used. It might be used someday. > --- > vm/vm_fault.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/vm/vm_fault.c b/vm

Re: [PATCH 3/5] kern: eliminate unused assignment

2013-11-10 Thread Samuel Thibault
Marin Ramesa, le Sun 10 Nov 2013 22:50:22 +0100, a écrit : > Value of result is never read. Eliminate the unused assignment. > > * kern/elf-load.c: Eliminate unused assignment. Justus has an ACKed better patch which propagates the result, but I don't see it applied on the tree, Justus? > --- >

Re: [PATCH 2/5] kern (rbtree_insert_rebalance): rewrite node swap

2013-11-10 Thread Samuel Thibault
Marin Ramesa, le Sun 10 Nov 2013 22:50:21 +0100, a écrit : > Value of node is never read. Simplify the node swap to one assignment > and remove the temporary variable. > > * kern/rbtree.c (rbtree_insert_rebalance): Simplify node swap. I'd rather keep it as such, as an expression of the rbtree rot

[PATCH 3/5] kern: eliminate unused assignment

2013-11-10 Thread Marin Ramesa
Value of result is never read. Eliminate the unused assignment. * kern/elf-load.c: Eliminate unused assignment. --- kern/elf-load.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kern/elf-load.c b/kern/elf-load.c index 1d103d3..c1f4bed 100644 --- a/kern/elf-load.c +++

[PATCH 5/5] vm: remove unused assignment

2013-11-10 Thread Marin Ramesa
Value of src_size is never read. Remove unused assignment. * vm/vm_map.c: Remove unused assignment. --- vm/vm_map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm/vm_map.c b/vm/vm_map.c index 2be7147..9d5b01c 100644 --- a/vm/vm_map.c +++ b/vm/vm_map.c @@ -3401,7 +3401,7 @

[PATCH 4/5] vm: remove duplicate assignment

2013-11-10 Thread Marin Ramesa
* vm/vm_fault.c: Remove duplicate assignment. --- vm/vm_fault.c | 1 - 1 file changed, 1 deletion(-) diff --git a/vm/vm_fault.c b/vm/vm_fault.c index 7e84961..aacf3cb 100644 --- a/vm/vm_fault.c +++ b/vm/vm_fault.c @@ -726,7 +726,6 @@ vm_fault_return_t vm_fault_page(first_object, first_offset,

[PATCH 1/5] kern: comment unused variable

2013-11-10 Thread Marin Ramesa
Variable reply_port is never used. There is indication in the comments that it might be used in future function call, so comment it. * kern/ipc_mig.c (syscall_device_writev_request): Comment variable. --- kern/ipc_mig.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/k

[PATCH 2/5] kern (rbtree_insert_rebalance): rewrite node swap

2013-11-10 Thread Marin Ramesa
Value of node is never read. Simplify the node swap to one assignment and remove the temporary variable. * kern/rbtree.c (rbtree_insert_rebalance): Simplify node swap. --- kern/rbtree.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kern/rbtree.c b/kern/rbtree.c index

Small cleanup of gnumach's assignments

2013-11-10 Thread Marin Ramesa
What follows is a small cleanup of gnumach's assignments. Patches are based on clang's "dead assignment" reports. [PATCH 1/5] kern: comment unused variable [PATCH 2/5] kern (rbtree_insert_rebalance): rewrite node swap [PATCH 3/5] kern: eliminate unused assignment [PATCH 4/5] vm: remove duplicate a

Re: [PATCH 2/2] avoid dereference of null pointer

2013-11-10 Thread Samuel Thibault
Marin Ramesa, le Sun 10 Nov 2013 18:16:20 +0100, a écrit : > On 10.11.2013 16:53:39, Samuel Thibault wrote: > > Marin Ramesa, le Sun 10 Nov 2013 16:46:30 +0100, a écrit : > > > Check to see if pte is a null pointer and perform dereference only > > > if that is not the case. > > > > > > * i386/inte

Re: [PATCH 2/2] avoid dereference of null pointer

2013-11-10 Thread Marin Ramesa
On 10.11.2013 16:53:39, Samuel Thibault wrote: > Marin Ramesa, le Sun 10 Nov 2013 16:46:30 +0100, a écrit : > > Check to see if pte is a null pointer and perform dereference only > > if that is not the case. > > > > * i386/intel/pmap.c (pte): Check if it is a null pointer. > > Well, it can never

Re: [PATCH 2/2] avoid dereference of null pointer

2013-11-10 Thread Samuel Thibault
Marin Ramesa, le Sun 10 Nov 2013 16:46:30 +0100, a écrit : > Check to see if pte is a null pointer and perform dereference only > if that is not the case. > > * i386/intel/pmap.c (pte): Check if it is a null pointer. Well, it can never be null, since earlier in the code we see the pv_h pointing t

Re: [PATCH 1/2] device: initialize to zero offset

2013-11-10 Thread Samuel Thibault
Marin Ramesa, le Sun 10 Nov 2013 16:46:29 +0100, a écrit : > Initialize addr to zero offset to quiet warnings about uninitialized > deallocation. > > * device/chario.c (addr): Initialize to zero. Applied, thanks. > --- > device/chario.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >

[PATCH 2/2] avoid dereference of null pointer

2013-11-10 Thread Marin Ramesa
Check to see if pte is a null pointer and perform dereference only if that is not the case. * i386/intel/pmap.c (pte): Check if it is a null pointer. --- i386/intel/pmap.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c index c1eca6

[PATCH 1/2] device: initialize to zero offset

2013-11-10 Thread Marin Ramesa
Initialize addr to zero offset to quiet warnings about uninitialized deallocation. * device/chario.c (addr): Initialize to zero. --- device/chario.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device/chario.c b/device/chario.c index c40705e..19f3bae 100644 --- a/device/ch

Re: [PATCH] libports: fix the thread counts in case the thread creation fails

2013-11-10 Thread Neal H. Walfield
At Sun, 10 Nov 2013 11:54:20 +0100, Samuel Thibault wrote: > > Neal H. Walfield, le Sun 10 Nov 2013 11:38:04 +0100, a écrit : > > At Sat, 9 Nov 2013 18:21:51 +0100, > > Samuel Thibault wrote: > > > > + pthread_spin_lock (&lock); > > > > + totalthreads--; > > > > +

Re: [PATCH] libports: fix the thread counts in case the thread creation fails

2013-11-10 Thread Samuel Thibault
Neal H. Walfield, le Sun 10 Nov 2013 11:38:04 +0100, a écrit : > At Sat, 9 Nov 2013 18:21:51 +0100, > Samuel Thibault wrote: > > > + pthread_spin_lock (&lock); > > > + totalthreads--; > > > + nreqthreads--; > > > + pthread_spin_unlock (&lock); > > It might be a good idea us

Re: [PATCH] libports: fix the thread counts in case the thread creation fails

2013-11-10 Thread Neal H. Walfield
At Sat, 9 Nov 2013 18:21:51 +0100, Samuel Thibault wrote: > > + pthread_spin_lock (&lock); > > + totalthreads--; > > + nreqthreads--; > > + pthread_spin_unlock (&lock); It might be a good idea use atomic operations instead of the spin lock (which is what the spin lo

Re: [PATCH 1/4] remove register qualifiers

2013-11-10 Thread Samuel Thibault
Applied, thanks! Samuel

[PATCH 1/4] remove register qualifiers

2013-11-10 Thread Marin Ramesa
* device/blkio.c: Remove register qualifiers. --- device/blkio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/device/blkio.c b/device/blkio.c index 27fec0e..939067d 100644 --- a/device/blkio.c +++ b/device/blkio.c @@ -41,9 +41,9 @@ io_return_t block_io(strat, max_cou

[PATCH 4/4] remove register qualifiers

2013-11-10 Thread Marin Ramesa
* device/subrs.c: Remove register qualifiers. --- device/subrs.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/device/subrs.c b/device/subrs.c index a82bae3..e094f68 100644 --- a/device/subrs.c +++ b/device/subrs.c @@ -61,11 +61,11 @@ u_char etherbroadcasta

[PATCH 2/4] remove definitions of ETHERMTU and ETHERMIN

2013-11-10 Thread Marin Ramesa
* device/if_ether.h (ETHERMTU, ETHERMIN): Remove unused definitions. --- device/if_ether.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/device/if_ether.h b/device/if_ether.h index 2ac938e..dbdd818 100644 --- a/device/if_ether.h +++ b/device/if_ether.h @@ -45,9 +45,6 @@ structethe

[PATCH 3/4] remove register qualifiers

2013-11-10 Thread Marin Ramesa
* device/net_io.c: Remove register qualifiers. --- device/net_io.c | 102 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/device/net_io.c b/device/net_io.c index fd71c02..1958840 100644 --- a/device/net_io.c +++ b/device/net