[PATCH 03/28] Modify db_read_bytes() and db_get_task_value()

2013-12-08 Thread Marin Ramesa
There is a case when db_read_bytes() returns early without initializing the data. Mark that case with the return value of -1 and let db_get_task_value() return -1 if the data has been uninitialized or the array index is out of bounds. * ddb/db_access.c (db_get_task_value) (data_uninitialized):

[PATCH 06/28] i386/i386/db_interface.c (db_write_bytes): simplify code

2013-12-08 Thread Marin Ramesa
Remove assignments without any effect and unnecessary variables. * i386/i386/db_interface.c (db_write_bytes) (oldmap0, addr1, ptep1, oldmap1): Remove variables. (db_write_bytes) (oldmap0, ptep0): Remove assignment. (db_write_bytes) (addr1, ptep1, oldmap1): Remove assignments. (db_write_bytes)

[PATCH 01/28] chips/busses.h: use boolean instead of a char

2013-12-08 Thread Marin Ramesa
A struct member which tracks if the device has been probed. It should really be a boolean instead of a char. * chips/busses.c (alive): Use boolean values. * chips/busses.h (alive): Use boolean instead of a char. * i386/i386at/autoconf.c (bus_device_init): Use boolean values in initialization.

[PATCH 04/28] ddb/db_examine.c: modify db_xcdump()

2013-12-08 Thread Marin Ramesa
Check for uninitialized data and print a message if that is the case. * ddb/db_examine.c (db_xcdump) (data_uninitialized): New variable. (db_xcdump): Check if data is uninitialized. (db_xcdump): Print a message if that is the case. --- ddb/db_examine.c | 16 +++- 1 file changed, 11

[PATCH 14/28] i386/i386at/kd.c: use io_req instead of uio

2013-12-08 Thread Marin Ramesa
Struct uio is nowhere defined and in device/buf.h the string uio is defined as io_req. Remove all declarations of uio structure and use io_req_t instead of it. * device/buf.h (uio, io_req): Remove definition. * i386/i386at/kd.c: Remove comment. (kdread): Use io_req_t. (kdwrite): Likewise. *

[PATCH 07/28] ddb/db_aout.c (aout_db_sym_init): remove unnecessary variable

2013-12-08 Thread Marin Ramesa
Member n_strx can be used instead of strx. * ddb/db_aout.c (aout_db_sym_init): Remove unnecessary variable. --- ddb/db_aout.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ddb/db_aout.c b/ddb/db_aout.c index 9e1c3d4..5cb3911 100644 --- a/ddb/db_aout.c +++

[PATCH 13/28] ddb/db_break.c (db_find_thread_breakpoint_here): remove unnecessary cast

2013-12-08 Thread Marin Ramesa
Variable addr is already of type db_addr_t. * ddb/db_break.c (db_find_thread_breakpoint_here) (addr): Don't cast to db_addr_t. --- ddb/db_break.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddb/db_break.c b/ddb/db_break.c index b3f13c6..f94663a 100644 ---

[PATCH 15/28] ddb/db_command.c: use boolean values

2013-12-08 Thread Marin Ramesa
* ddb/db_command.c (db_cmd_loop_done): Use boolean values. --- ddb/db_command.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ddb/db_command.c b/ddb/db_command.c index b2b2a46..e8792d0 100644 --- a/ddb/db_command.c +++ b/ddb/db_command.c @@ -303,7 +303,7 @@

[PATCH 11/28] ddb/db_aout.c (aout_db_lookup): remove forward declaration

2013-12-08 Thread Marin Ramesa
* ddb/db_aout.c (db_sym_parse_and_lookup): Remove forward declaration. * ddb/db_sym.h (db_sym_parse_and_lookup): Add prototype. --- ddb/db_aout.c | 2 -- ddb/db_sym.h | 6 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ddb/db_aout.c b/ddb/db_aout.c index 3a48533..76bc893

[PATCH 10/28] ddb/db_aout.c (aout_db_qualified_search): use DB_SYM_NULL as return value

2013-12-08 Thread Marin Ramesa
Function aout_db_qualified_search() returns db_sym_t. Use DB_SYM_NULL as return value instead of zero. * ddb/db_aout.c (aout_db_qualified_search): Use DB_SYM_NULL as return value. --- ddb/db_aout.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ddb/db_aout.c

[PATCH 05/28] i386/i386/db_interface.c: remove forward declaration

2013-12-08 Thread Marin Ramesa
* i386/i386/db_interface.c (db_write_bytes_user_space): Remove forward declaration. * i386/i386/db_interface.h (db_write_bytes_user_space): Add prototype. --- i386/i386/db_interface.c | 1 - i386/i386/db_interface.h | 7 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git

[PATCH 08/28] ddb/db_aout.c (aout_db_eq_name): remove unnecessary variable

2013-12-08 Thread Marin Ramesa
Variable name can be used instead of s2. * ddb/db_aout.c (aout_db_eq_name): Remove unnecessary variable. --- ddb/db_aout.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ddb/db_aout.c b/ddb/db_aout.c index 5cb3911..63fa518 100644 --- a/ddb/db_aout.c +++

[PATCH 18/28] ddb/db_command.c (db_command_list): remove forward declaration

2013-12-08 Thread Marin Ramesa
* ddb/db_command.c (db_skip_to_eol): Remove forward declaration. --- ddb/db_command.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/ddb/db_command.c b/ddb/db_command.c index 0949f8b..eaad192 100644 --- a/ddb/db_command.c +++ b/ddb/db_command.c @@ -298,8 +298,6 @@

[PATCH 23/28] ddb/db_mp.c: use boolean instead of an int

2013-12-08 Thread Marin Ramesa
* ddb/db_mp.c (db_enter_debug): Use boolean instead of an int. --- ddb/db_mp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddb/db_mp.c b/ddb/db_mp.c index 1785e4d..b99718e 100644 --- a/ddb/db_mp.c +++ b/ddb/db_mp.c @@ -53,7 +53,7 @@ int db_active[NCPUS] = { 0 };

[PATCH 24/28] ddb/db_mp.c (remote_db): comment the call to cpu_interrupt_to_db()

2013-12-08 Thread Marin Ramesa
This wasn't noticed before since the number of cpus is always one I guess, but cpu_interrupt_to_db() is without definition. Comment the call. * ddb/db_mp.c (cpu_interrupt_to_db): Comment the call. --- ddb/db_mp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddb/db_mp.c

[PATCH 09/28] ddb/db_aout.c (aout_db_is_filename): remove unnecessary check

2013-12-08 Thread Marin Ramesa
First loop iteration ensures that the value is non-zero. Second loop iteration likewise. Therefore name[1] is always non-zero if the loop is executed. * ddb/db_aout.c (aout_db_is_filename): Remove unnecessary check. --- ddb/db_aout.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-)

[PATCH 12/28] ddb/db_break.c (db_add_thread_breakpoint): fix argument list

2013-12-08 Thread Marin Ramesa
* ddb/db_break.c (db_add_thread_breakpoint): Fix argument list. --- ddb/db_break.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ddb/db_break.c b/ddb/db_break.c index 0491be7..b3f13c6 100644 --- a/ddb/db_break.c +++ b/ddb/db_break.c @@ -92,6 +92,7 @@ static int

[PATCH 25/28] ddb/db_mp.c: definition of db_console() only if CONSOLE_ON_MASTER

2013-12-08 Thread Marin Ramesa
Function db_console() is called only if CONSOLE_ON_MASTER. If it stays this way, db_console() will not compile. I don't know if it should be removed. Maybe someone will rewrite it. * ddb/db_mp.c (db_console): Definition only if CONSOLE_ON_MASTER. * ddb/db_mp.h [CONSOLE_ON_MASTER] (db_console):

[PATCH 19/28] ddb/db_examine.c (db_examine_cmd): remove forward declaration

2013-12-08 Thread Marin Ramesa
* ddb/db_examine.c (db_option): Remove forward declaration. --- ddb/db_examine.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ddb/db_examine.c b/ddb/db_examine.c index 1ceff41..d8ee9bf 100644 --- a/ddb/db_examine.c +++ b/ddb/db_examine.c @@ -65,7 +65,6 @@ db_examine_cmd(addr, have_addr,

[PATCH 17/28] ddb/db_command.c (db_command): remove forward declaration

2013-12-08 Thread Marin Ramesa
* ddb/db_command.c (db_fncall): Remove forward declaration. --- ddb/db_command.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ddb/db_command.c b/ddb/db_command.c index cb3e4d7..0949f8b 100644 --- a/ddb/db_command.c +++ b/ddb/db_command.c @@ -177,7 +177,6 @@ db_command(last_cmdp, cmd_table)

[PATCH 22/28] ddb/db_expr.c (db_add_expr): remove unnecessary variable

2013-12-08 Thread Marin Ramesa
Value db_tok_string[0] can be used instead of c. * ddb/db_expr.c (db_add_expr): Remove unnecessary variable. --- ddb/db_expr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ddb/db_expr.c b/ddb/db_expr.c index bd68f92..a74cdec 100644 --- a/ddb/db_expr.c +++

[PATCH 20/28] ddb/db_examine.c: trivial stylistic fix for consistency

2013-12-08 Thread Marin Ramesa
* ddb/db_examine.c: Trivial stylistic fix for consistency. --- ddb/db_examine.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ddb/db_examine.c b/ddb/db_examine.c index d8ee9bf..4b76d33 100644 --- a/ddb/db_examine.c +++ b/ddb/db_examine.c @@ -78,7 +78,7 @@

[PATCH 26/28] ddb/db_print.c: use unsigned long instead of an unsigned int

2013-12-08 Thread Marin Ramesa
Variable db_maxoff is in other files declared as unsigned long. * ddb/db_print.c (db_maxoff): Use unsigned long instead of an unsigned int. --- ddb/db_print.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddb/db_print.c b/ddb/db_print.c index 75c914e..fbc0960 100644 ---

[PATCH 21/28] ddb/db_expr.c (db_mult_expr): remove unnecessary variable

2013-12-08 Thread Marin Ramesa
Value db_tok_string[0] can be used instead of c. * ddb/db_expr.c (db_mult_expr): Remove unnecessary variable. --- ddb/db_expr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ddb/db_expr.c b/ddb/db_expr.c index eee9e4f..bd68f92 100644 --- a/ddb/db_expr.c +++

[PATCH 27/28] Use db_addr_t instead of db_expr_t

2013-12-08 Thread Marin Ramesa
In this way everything falls into place and there is one cast less. Function db_task_printsym() is already always called with the cast to db_addr_t in the first argument. * ddb/db_aout.c (aout_db_line_at_pc): Use db_addr_t instead of db_expr_t. (aout_db_search_by_addr): Don't cast to

[PATCH 28/28] ddb/db_trap.c (db_task_trap): remove forward declarations

2013-12-08 Thread Marin Ramesa
* ddb/db_break.h (db_check_breakpoint_valid): Add prototype. * ddb/db_trap.c (db_init_default_thread, db_check_breakpoint_valid): Remove forward declarations. --- ddb/db_break.h | 2 ++ ddb/db_trap.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ddb/db_break.h

Re: [PATCH 01/14] i386/i386at/kd.c: fix signed overflow (a warning from GCC)

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Mon 02 Dec 2013 22:54:39 +0100, a écrit : - for ( ; (c != K_DONE) (char_idx = max); + for ( ; ((char)c != K_DONE) (char_idx = max); I have rather made K_DONE an unsigned, simply. It definitely has to be an unsigned anyway, since it's

Re: [PATCH 02/14] i386/i386at/kd.c: remove useless old code

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Mon 02 Dec 2013 22:54:40 +0100, a écrit : * i386/i386at/kd.c [old]: Remove code. Unless you are sure the code should go away, don't remove it. Actually it seems old code is the proper one, and the other code is a workaround for some bogus hardware, which we may want to just

Re: [PATCH 04/14] ddb/db_macro.c: move struct definition to a header file

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Mon 02 Dec 2013 22:54:42 +0100, a écrit : * ddb/db_macro.c (db_user_macro): Move struct definition to ddb/db_macro.h. Ditto. --- ddb/db_macro.c | 6 -- ddb/db_macro.h | 8 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ddb/db_macro.c

Re: [PATCH 03/14] ddb/db_cond.c: move struct definition to a header file

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Mon 02 Dec 2013 22:54:41 +0100, a écrit : * ddb/db_cond.c (db_cond): Move struct definition to ddb/db_cond.h. Why? It's not used anywhere else. --- ddb/db_cond.c | 7 --- ddb/db_cond.h | 7 +++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git

Re: [PATCH 06/14] i386/intel/pmap.c: move struct definitions to a header file

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Mon 02 Dec 2013 22:54:44 +0100, a écrit : * i386/intel/pmap.c (pv_entry, pmap_update_item, pmap_update_list): Move struct definitions to i386/intel/pmap.h. Ditto. --- i386/intel/pmap.c | 45 - i386/intel/pmap.h | 46

Re: [PATCH 07/14] ipc/ipc_hash.c: move struct definition to a header file

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Mon 02 Dec 2013 22:54:45 +0100, a écrit : * ipc/ipc_hash.c (ipc_hash_global_bucket): Move struct definition to ipc/ipc_hash.h. Ditto. --- ipc/ipc_hash.c | 7 --- ipc/ipc_hash.h | 7 +++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git

Re: [PATCH 05/14] i386/i386/idt.c: move struct definition to a header file

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Mon 02 Dec 2013 22:54:43 +0100, a écrit : * i386/i386/idt.c (idt_init_entry): Move struct definition to i386/i386/idt-gen.h. Ditto. --- i386/i386/idt-gen.h | 7 +++ i386/i386/idt.c | 6 -- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git

Re: [PATCH 10/14] kern/act.c: move struct definition to a header file

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Mon 02 Dec 2013 22:54:48 +0100, a écrit : * kern/act.c (GetSetState): Move struct definition to kern/act.h. Ditto. --- kern/act.c | 8 kern/act.h | 7 +++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/kern/act.c b/kern/act.c index

Re: [PATCH 08/14] ipc/ipc_marequest.c: move struct definition to a header file

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Mon 02 Dec 2013 22:54:46 +0100, a écrit : * ipc/ipc_marequest.c (ipc_marequest_bucket): Move struct definition to ipc/ipc_marequest.h. * ipc/ipc_marequest.h: Include kern/lock.h. Ditto. --- ipc/ipc_marequest.c | 7 --- ipc/ipc_marequest.h | 8 2 files

Re: [PATCH 11/14] kern/lock.c: move struct definition to a header file

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Mon 02 Dec 2013 22:54:49 +0100, a écrit : * kern/lock.c [MACH_SLOCKS NCPUS == 1] (simple_locks_info): Move struct definition to kern/lock.h. Ditto. --- kern/lock.c | 5 - kern/lock.h | 7 +++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git

Re: [PATCH 14/14] vm/vm_resident.c: move struct definition to a header file

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Mon 02 Dec 2013 22:54:52 +0100, a écrit : * vm/vm_resident.c: Include vm/vm_resident.h. (vm_page_bucket_t): Move struct defintion to vm/vm_resident.h. Ditto. --- vm/vm_resident.c | 5 + vm/vm_resident.h | 5 + 2 files changed, 6 insertions(+), 4 deletions(-)

Re: [PATCH 13/14] vm/vm_fault.c: move struct definition to a header file

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Mon 02 Dec 2013 22:54:51 +0100, a écrit : * vm/vm_fault.c (vm_fault_state): Move struct definition to vm/vm_fault.h. Ditto. --- vm/vm_fault.c | 26 -- vm/vm_fault.h | 24 2 files changed, 24 insertions(+), 26 deletions(-)

Re: [PATCH 12/14] vm/memory_object_proxy.c: move struct definition to a header file

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Mon 02 Dec 2013 22:54:50 +0100, a écrit : * vm/memory_object_proxy.c (memory_object_proxy): Move struct definition to vm/memory_object_proxy.h. Ditto. --- vm/memory_object_proxy.c | 10 -- vm/memory_object_proxy.h | 9 + 2 files changed, 9 insertions(+),

Re: [PATCH 03/66] chips/busses.h: remove ifdef

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Thu 05 Dec 2013 22:02:57 +0100, a écrit : This code is used even if KERNEL is not defined. Where? KERNEL is always defined for the kernel build. It is not defined only in userland, which doesn't have access to these arrays and functions. Remove the ifdef. * chips/busses.h

Re: [PATCH 09/66] device/blkio.c: remove function

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Thu 05 Dec 2013 22:03:03 +0100, a écrit : Function block_io_mmap() is never a dev op, therefore it is unused and it can be written again easily if needed. - if (device-dev_ops-d_mmap == block_io_mmap) { - d-type = DEV_PAGER_TYPE; - } else { -

Re: [PATCH 12/66] device/cons.h: remove ifdef

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Thu 05 Dec 2013 22:03:06 +0100, a écrit : Field constab is used even if KERNEL is not defined. Remove the ifdef. Ditto. * device/cons.h [KERNEL]: Remove ifdef. --- device/cons.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/device/cons.h b/device/cons.h index

Re: [PATCH 15/66] device/if_ether.h: remove ifdef

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Thu 05 Dec 2013 22:03:09 +0100, a écrit : Function ether_sprintf() is used even if KERNEL is not defined. Avoid implicit declaration in that case by removing the ifdef. Ditto. * device/if_ether.h [KERNEL]: Remove ifdef. --- device/if_ether.h | 2 -- 1 file changed, 2

Re: [PATCH 20/66] i386/i386/db_interface.c: remove dead assignment

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Thu 05 Dec 2013 22:03:14 +0100, a écrit : * i386/i386/db_interface.c (i386_last_saved_statep): Remove variable. (i386_last_saved_statep): Remove dead assignment. This looks like a debugging helper, to be kept. --- i386/i386/db_interface.c | 2 -- 1 file changed, 2

Re: [PATCH 21/66] i386/i386/db_interface.c: remove dead assignment

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Thu 05 Dec 2013 22:03:15 +0100, a écrit : * i386/i386/db_interface.c (i386_nested_saved_state): Remove variable. (i386_nested_saved_state): Remove dead assignment. Ditto. --- i386/i386/db_interface.c | 2 -- 1 file changed, 2 deletions(-) diff --git

Re: [PATCH 22/66] i386/i386/db_interface.c: remove dead assignment

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Thu 05 Dec 2013 22:03:16 +0100, a écrit : * i386/i386/db_interface.c (i386_last_kdb_sp): Remove variable. (i386_last_kdb_sp): Remove dead assignment. Ditto. --- i386/i386/db_interface.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/i386/i386/db_interface.c

Re: [PATCH 02/14] i386/i386at/kd.c: remove useless old code

2013-12-08 Thread Marin Ramesa
On 08.12.2013 15:27:12, Samuel Thibault wrote: Marin Ramesa, le Mon 02 Dec 2013 22:54:40 +0100, a écrit : * i386/i386at/kd.c [old]: Remove code. Unless you are sure the code should go away, don't remove it. Actually it seems old code is the proper one, and the other code is a workaround

Re: [PATCH 25/66] i386/i386/mp_desc.c: remove dead assignment

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Thu 05 Dec 2013 22:03:19 +0100, a écrit : * i386/i386/mp_desc.c (mp_desc_table): Remove variable. (mp_desc_table): Remove dead assignment. * i386/i386/mp_desc.h (mp_desc_table): Remove declaration. Probably useful for debugging too. --- i386/i386/mp_desc.c | 6 --

Re: [PATCH 03/14] ddb/db_cond.c: move struct definition to a header file

2013-12-08 Thread Marin Ramesa
On 08.12.2013 15:28:06, Samuel Thibault wrote: Marin Ramesa, le Mon 02 Dec 2013 22:54:41 +0100, a écrit : * ddb/db_cond.c (db_cond): Move struct definition to ddb/db_cond.h. Why? It's not used anywhere else. I just tought it looks better this way. Guess I'm not used to seeing struct

Re: [PATCH 31/66] i386/i386at/com.c: simplify code

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Thu 05 Dec 2013 22:03:25 +0100, a écrit : Variable comtimer_active is used uninitialized. What's the chance of this variable getting the value FALSE? @@ -64,7 +64,6 @@ struct tty com_tty[NCOM]; int commodem[NCOM]; int comcarrier[NCOM] = {0, 0,}; boolean_t comfifo[NCOM];

Re: [PATCH 32/66] i386/i386at/com.c: remove dead assignment

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Thu 05 Dec 2013 22:03:26 +0100, a écrit : * i386/i386at/com.c (comtimer_state): Remove variable. (comtimer_state): Remove dead assignment. Now still used. --- i386/i386at/com.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/i386/i386at/com.c b/i386/i386at/com.c

Re: [PATCH 03/66] chips/busses.h: remove ifdef

2013-12-08 Thread Marin Ramesa
On 08.12.2013 15:46:00, Samuel Thibault wrote: Marin Ramesa, le Thu 05 Dec 2013 22:02:57 +0100, a écrit : This code is used even if KERNEL is not defined. Where? KERNEL is always defined for the kernel build. It is not defined only in userland, which doesn't have access to these arrays

Re: [PATCH 03/66] chips/busses.h: remove ifdef

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Sun 08 Dec 2013 16:04:32 +0100, a écrit : On 08.12.2013 15:46:00, Samuel Thibault wrote: Marin Ramesa, le Thu 05 Dec 2013 22:02:57 +0100, a écrit : This code is used even if KERNEL is not defined. Where? KERNEL is always defined for the kernel build. It is not

Re: [PATCH 35/66] i386/i386at/kd.c: simplify code

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Thu 05 Dec 2013 22:03:29 +0100, a écrit : Variable char_byte_width is always zero. Use this to simplify the code. Well, it should actually always be one. There is probably some other bug to fix here. * i386/i386at/kd.c (char_byte_width): Remove variable. (j): Remove

Re: [PATCH 36/66] i386/i386at/kd.c: simplify code

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Thu 05 Dec 2013 22:03:30 +0100, a écrit : Variable fb_byte_width is always zero. Use this to simplify the code. Ditto. * i386/i386at/kd.c (fb_byte_width): Remove variable. (to): Remove variable. (bit2fbptr): Remove assignment. (to): Likewise. (to, fp, i): Remove

Re: [PATCH 37/66] i386/i386at/kd.c: simplify code

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Thu 05 Dec 2013 22:03:31 +0100, a écrit : Variable font_byte_width is always zero. Use this to simplify the code. Ditto. * i386/i386at/kd.c (font_byte_width): Remove variable. (i, from): Remove variables. Remove for loop. * i386/i386at/kdsoft.h (font_byte_width): Remove

Re: [PATCH 40/66] i386/i386at/kd.h: remove ifdef

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Thu 05 Dec 2013 22:03:34 +0100, a écrit : Variable key_map is used even if KERNEL is not defined. Remove ifdef. Ditto. * i386/i386at/kd.h [KERNEL]: Remove ifdef. --- i386/i386at/kd.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/i386/i386at/kd.h

Re: [PATCH 41/66] i386/i386at/kd.h: remove ifdef

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Thu 05 Dec 2013 22:03:35 +0100, a écrit : Variable kb_mode is used even if KERNEL is not defined. Remove ifdef. Ditto. * i386/i386at/kd.h [KERNEL]: Remove ifdef. --- i386/i386at/kd.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/i386/i386at/kd.h

Re: [PATCH 42/66] i386/i386at/lpr.c: remove uninitialized variable

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Thu 05 Dec 2013 22:03:36 +0100, a écrit : Variable lpr_alive is never initialized. Again, it is, like all statically-allocated variables, to zero. I suggest a removal of the code that deals with this variable. But, on the other hand, maybe the variable should be

Re: [PATCH 50/66] kern/act.c, act.h: comment unused variable

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Thu 05 Dec 2013 22:03:44 +0100, a écrit : * kern/act.c (null_act): Comment unused variable. Well, it is used, by being initialized. The comment above explains what it's used for. * kern/act.h (null_act): Likewise. --- kern/act.c | 2 +- kern/act.h | 2 +- 2 files

Re: [PATCH 53/66] kern/debug.c: initialize panicstr

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Thu 05 Dec 2013 22:03:47 +0100, a écrit : Variable that keeps the panic string. Initialize to NULL, meaning that the initial condition is that there is no panic string. Again, that's already initialized to 0. * kern/debug.c (panicstr): Initialize to NULL. ---

Re: [PATCH 54/66] kern/debug.c: remove unused variable

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Thu 05 Dec 2013 22:03:48 +0100, a écrit : * kern/debug.c (__stack_chk_guard): Remove unused variable. Actually it is used by the gcc compiler. --- kern/debug.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/kern/debug.c b/kern/debug.c index 8cd3f02..d3ae4fa

Re: [PATCH 66/66] kern/processor.h: remove ifdef

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Thu 05 Dec 2013 22:04:00 +0100, a écrit : This code is used even if KERNEL is not defined. Remove the ifdef. Ditto. * kern/processor.h [KERNEL]: Remove ifdef. --- kern/processor.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/kern/processor.h b/kern/processor.h

Re: [PATCH 09/18] kern/bootstrap.c: move struct definition to a header file

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Fri 06 Dec 2013 16:29:51 +0100, a écrit : * kern/bootstrap.c: Include kern/bootstrap.h. (user_bootstrap_info): Move struct definition to kern/bootstrap.h. Ditto. --- kern/bootstrap.c | 10 +- kern/bootstrap.h | 8 2 files changed, 9 insertions(+), 9

Re: [PATCH 08/18] kern/boot_script.c: move struct definitions to a header file

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Fri 06 Dec 2013 16:29:50 +0100, a écrit : * kern/boot_script.c (sym, arg): Move struct definitions to kern/boot_script.h. Ditto. --- kern/boot_script.c | 41 - kern/boot_script.h | 39 +++ 2

Re: [PATCH 11/18] kern/exception.c: move struct definition to a header file

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Fri 06 Dec 2013 16:29:53 +0100, a écrit : * kern/exception.c (mach_exception): Move struct definition to kern/exception.h. Ditto. --- kern/exception.c | 14 -- kern/exception.h | 14 ++ 2 files changed, 14 insertions(+), 14 deletions(-) diff

Re: [PATCH 12/18] kern/debug.c: fix implicit declaration of function

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Fri 06 Dec 2013 16:29:54 +0100, a écrit : This include fixes the implicit declaration of function. But I don't know if it is correct to include here stuff from i386at. It is not, one can use machine/model_dep.h instead. * kern/debug.c: Include i386at/model_dep.h. ---

Re: [PATCH 13/18] kern/machine.c: fix implicit declaration of function

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Fri 06 Dec 2013 16:29:55 +0100, a écrit : This include fixes the implicit declaration of function. But I don't know if it is correct to include here stuff from i386at. Ditto. * kern/machine.c: Include i386at/model_dep.h. --- kern/machine.c | 2 +- 1 file changed, 1

Re: [PATCH 17/18] i386/i386at/kd_event.c: fix difference in signedness

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Fri 06 Dec 2013 16:29:59 +0100, a écrit : * i386/i386at/kd_event.c (X_kdb_enter_init, X_kdb_exit_init): Modify argument type. memcpy() has a pointer to void as a second argument so it's all the same. * i386/i386at/kd_event.h (X_kdb_enter_init, X_kdb_exit_init): Modify

Re: [PATCH 01/28] chips/busses.h: use boolean instead of a char

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Sun 08 Dec 2013 12:40:03 +0100, a écrit : A struct member which tracks if the device has been probed. It should really be a boolean instead of a char. I'd rather not, since it changes its size. * chips/busses.c (alive): Use boolean values. * chips/busses.h (alive): Use

Re: [PATCH 02/28] chips/busses.c: comment out dead code

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Sun 08 Dec 2013 12:40:04 +0100, a écrit : Field bus_master_init is initialized to zero Well, that's just because it's not used ATM. It could be. and therefore configure_bus_master() always returns FALSE without any effect on bus_master_init. The for loops in

Re: [PATCH 06/28] i386/i386/db_interface.c (db_write_bytes): simplify code

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Sun 08 Dec 2013 12:40:08 +0100, a écrit : Remove assignments without any effect and unnecessary variables. Err, *ptep0 assignment does have an effect, what makes you think otherwise? * i386/i386/db_interface.c (db_write_bytes) (oldmap0, addr1, ptep1, oldmap1): Remove

Re: [PATCH 07/28] ddb/db_aout.c (aout_db_sym_init): remove unnecessary variable

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Sun 08 Dec 2013 12:40:09 +0100, a écrit : Member n_strx can be used instead of strx. But that's less readable. A variable here is really not a problem, the compiler will most probably put it in a register anyway. * ddb/db_aout.c (aout_db_sym_init): Remove unnecessary

Re: [PATCH 08/28] ddb/db_aout.c (aout_db_eq_name): remove unnecessary variable

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Sun 08 Dec 2013 12:40:10 +0100, a écrit : Variable name can be used instead of s2. Ditto. * ddb/db_aout.c (aout_db_eq_name): Remove unnecessary variable. --- ddb/db_aout.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ddb/db_aout.c

Re: [PATCH 09/28] ddb/db_aout.c (aout_db_is_filename): remove unnecessary check

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Sun 08 Dec 2013 12:40:11 +0100, a écrit : First loop iteration ensures that the value is non-zero. Second loop iteration likewise. Therefore name[1] is always non-zero if the loop is executed. Uh? It seems wrong to me. Please show a precise variable evolution shart. *

Re: [PATCH 16/28] ddb/db_command.c (db_command): use db_addr_t instead of db_expr_t

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Sun 08 Dec 2013 12:40:18 +0100, a écrit : In this way there are two casts less. Yes, but - addr = (db_expr_t)db_next; This kind of cast is preferrable to + if (db_expression((db_expr_t *)addr)) { that one, because whatever the actual sizes, the first

Re: [PATCH 22/28] ddb/db_expr.c (db_add_expr): remove unnecessary variable

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Sun 08 Dec 2013 12:40:24 +0100, a écrit : Value db_tok_string[0] can be used instead of c. Ditto. * ddb/db_expr.c (db_add_expr): Remove unnecessary variable. --- ddb/db_expr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ddb/db_expr.c

Re: [PATCH 21/28] ddb/db_expr.c (db_mult_expr): remove unnecessary variable

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Sun 08 Dec 2013 12:40:23 +0100, a écrit : Value db_tok_string[0] can be used instead of c. Ditto. * ddb/db_expr.c (db_mult_expr): Remove unnecessary variable. --- ddb/db_expr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ddb/db_expr.c

Re: [PATCH 24/28] ddb/db_mp.c (remote_db): comment the call to cpu_interrupt_to_db()

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Sun 08 Dec 2013 12:40:26 +0100, a écrit : This wasn't noticed before since the number of cpus is always one I guess, but cpu_interrupt_to_db() is without definition. Comment the call. Well, I prefer the issue to be noticed at compilation and thus spotted immediately rather than

Re: [PATCH 03/14] ddb/db_cond.c: move struct definition to a header file

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Sun 08 Dec 2013 16:00:29 +0100, a écrit : On 08.12.2013 15:28:06, Samuel Thibault wrote: Marin Ramesa, le Mon 02 Dec 2013 22:54:41 +0100, a écrit : * ddb/db_cond.c (db_cond): Move struct definition to ddb/db_cond.h. Why? It's not used anywhere else. I just tought it

Re: [PATCH 06/28] i386/i386/db_interface.c (db_write_bytes): simplify code

2013-12-08 Thread Marin Ramesa
On 08.12.2013 16:46:20, Samuel Thibault wrote: Marin Ramesa, le Sun 08 Dec 2013 12:40:08 +0100, a écrit : Remove assignments without any effect and unnecessary variables. Err, *ptep0 assignment does have an effect, what makes you think otherwise? I don't see it. Maybe it's the call to

Re: [PATCH 09/28] ddb/db_aout.c (aout_db_is_filename): remove unnecessary check

2013-12-08 Thread Marin Ramesa
On 08.12.2013 16:49:36, Samuel Thibault wrote: Marin Ramesa, le Sun 08 Dec 2013 12:40:11 +0100, a écrit : First loop iteration ensures that the value is non-zero. Second loop iteration likewise. Therefore name[1] is always non-zero if the loop is executed. Uh? It seems wrong to me.

Re: [PATCH 06/28] i386/i386/db_interface.c (db_write_bytes): simplify code

2013-12-08 Thread Samuel Thibault
Marin Ramesa, le Sun 08 Dec 2013 17:38:10 +0100, a écrit : On 08.12.2013 16:46:20, Samuel Thibault wrote: Marin Ramesa, le Sun 08 Dec 2013 12:40:08 +0100, a écrit : Remove assignments without any effect and unnecessary variables. Err, *ptep0 assignment does have an effect, what makes

Re: [PATCH 01/14] i386/i386at/kd.c: fix signed overflow (a warning from GCC)

2013-12-08 Thread Marin Ramesa
On 08.12.2013 15:25:42, Samuel Thibault wrote: Marin Ramesa, le Mon 02 Dec 2013 22:54:39 +0100, a écrit : -for ( ; (c != K_DONE) (char_idx = max); +for ( ; ((char)c != K_DONE) (char_idx = max); I have rather made K_DONE an unsigned, simply. It definitely has to be an unsigned anyway,

Re: [PATCH 06/28] i386/i386/db_interface.c (db_write_bytes): simplify code

2013-12-08 Thread Marin Ramesa
On 09.12.2013 06:40:25, Samuel Thibault wrote: Marin Ramesa, le Sun 08 Dec 2013 17:38:10 +0100, a écrit : On 08.12.2013 16:46:20, Samuel Thibault wrote: Marin Ramesa, le Sun 08 Dec 2013 12:40:08 +0100, a écrit : Remove assignments without any effect and unnecessary variables.

Re: [PATCH 2/2] kern/lock.h: XXX quiet GCC warnings about set but unused variables during simple locks

2013-12-08 Thread Marin Ramesa
On 02.12.2013 09:14:36, Marin Ramesa wrote: * kern/lock.h (decl_simple_lock_data): Define macro. (simple_unlock): Define so that lock is assigned to itself and add a comment saying why this was done. (simple_lock_try): Define so that lock data is cast to a boolean with the value TRUE and