Re: [PATCHv2 5/7] hurd: remove unused variables

2020-05-30 Thread Simon Marchi
On 2020-05-29 6:03 p.m., Samuel Thibault wrote: > Fixes > > ../../gdb/gnu-nat.c:2554:7: error: unused variable ‘res’ > [-Werror=unused-variable] > 2554 | int res; > ../../gdb/gnu-nat.c:2644:20: error: unused variable ‘old_address’ > [-Werror=unused-variable] > 2644 | vm_address_t old_a

[PATCHv2 5/7] hurd: remove unused variables

2020-05-29 Thread Samuel Thibault
Fixes ../../gdb/gnu-nat.c:2554:7: error: unused variable ‘res’ [-Werror=unused-variable] 2554 | int res; ../../gdb/gnu-nat.c:2644:20: error: unused variable ‘old_address’ [-Werror=unused-variable] 2644 | vm_address_t old_address = region_address; gdb/ChangeLog: 2020-05-29 Samuel Thi

[PATCH 5/5] hurd: remove unused variables

2020-05-29 Thread Samuel Thibault
gdb/ChangeLog: 2020-05-29 Samuel Thibault * gnu-nat.c (gnu_xfer_auxv): Remove unused `res' variable. (gnu_nat_target::find_memory_regions): Remove unused `old_address' variable. diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c index 3b438a9a43..78e9ab7f71 100644 --- a/gdb/g

Re: [PATCH 2/8] mach-defpager: fix warnings about unused variables

2014-03-12 Thread Samuel Thibault
Justus Winter, le Wed 12 Mar 2014 15:55:48 +0100, a écrit : > * mach-defpager/default_pager.c (pager_alloc): Declare variables only > when needed. > (dealloc_direct): Remove unused variables. > (seqnos_memory_object_terminate): Remove unused variable, adjust > ddprin

[PATCH 2/8] mach-defpager: fix warnings about unused variables

2014-03-12 Thread Justus Winter
* mach-defpager/default_pager.c (pager_alloc): Declare variables only when needed. (dealloc_direct): Remove unused variables. (seqnos_memory_object_terminate): Remove unused variable, adjust ddprintfs accordingly. (seqnos_memory_object_data_write): Remove unused variable. --- mach-defpager

[PATCH 2/2] kern: quiet GCC warnings about set but unused variables

2013-12-15 Thread Marin Ramesa
* kern/lock.h (simple_lock_data_empty): Define. (decl_simple_lock_data, simple_unlock): Likewise. * kern/sched_prim.c (lock): Declare. [MACH_SLOCKS]: Remove #ifs. * kern/task.c (task_lock, task_unlock): Remove address operator. --- kern/lock.h | 6 -- kern/sched_prim.c | 18 +++

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

2013-12-15 Thread Samuel Thibault
Marin Ramesa, le Sun 15 Dec 2013 22:00:12 +0100, a écrit : > @@ -228,6 +228,8 @@ void assert_wait( > thread_tthread; > #if MACH_SLOCKS > simple_lock_t lock; > +#else /* MACH_SLOCKS */ > + decl_simple_lock_data( , *lock); > #endif /* MACH_SLOCKS */

[PATCH 2/2] kern/lock.h: quiet GCC warnings about set but unused variables

2013-12-15 Thread Marin Ramesa
* kern/lock.h (simple_lock_data_empty): Define. (decl_simple_lock_data, simple_unlock): Likewise. * kern/sched_prim.c (lock): Declare. * kern/task.c (task_lock, task_unlock) (task): Remove address operator. --- kern/lock.h | 6 -- kern/sched_prim.c | 6 ++ kern/task.c | 4 ++--

Re: [PATCH 2/6] kern/lock.h: quiet GCC warnings about set but unused variables

2013-12-15 Thread Marin Ramesa
On 15.12.2013 20:13:22, Samuel Thibault wrote: > > index 8fe3672..67067cf 100644 > > --- a/kern/task.c > > +++ b/kern/task.c > > @@ -769,7 +769,7 @@ kern_return_t task_info( > > event_info->cow_faults = task->cow_faults; > > event_info->messages_sent = task->messages_sent;

Re: [PATCH 2/6] kern/lock.h: quiet GCC warnings about set but unused variables

2013-12-15 Thread Samuel Thibault
Marin Ramesa, le Thu 12 Dec 2013 18:27:04 +0100, a écrit : > --- a/kern/lock.h > +++ b/kern/lock.h > @@ -94,7 +94,10 @@ extern voidcheck_simple_locks(void); > /* > * Do not allocate storage for locks if not needed. > */ > -#define decl_simple_lock_data(class,name) > +struc

[PATCH 2/6] kern/lock.h: quiet GCC warnings about set but unused variables

2013-12-12 Thread Marin Ramesa
about set but unused variables. * kern/lock.h (l): Define. (decl_simple_lock_data): Likewise. (simple_unlock): Likewise. * kern/sched_prim.c [!MACH_SLOCKS] (lock): Declare. * kern/task.c (task_info) (task_unlock) (task): Remove address operator. --- kern/lock.h | 9 ++--- kern

Re: [PATCH 4/8] Quiet GCC warnings about set but unused variables

2013-12-12 Thread Marin Ramesa
Then I have to define decl_simple_lock_data() which means we end up > > with a lot of unused locks. And simple_lock_try() needs to always > > suceed with the value TRUE which means locks can't be initialized > > to zero. > > > > It seems the best solution i

Re: [PATCH 4/8] Quiet GCC warnings about set but unused variables

2013-12-11 Thread Richard Braun
k_try() needs to always > suceed with the value TRUE which means locks can't be initialized to > zero. > > It seems the best solution is to use #ifs for MACH_SLOCKS to declare > and set these unused variables. GCC allows empty structures as an extension. -- Richard Braun

Re: [PATCH 4/8] Quiet GCC warnings about set but unused variables

2013-12-11 Thread Marin Ramesa
ems the best solution is to use #ifs for MACH_SLOCKS to declare and set these unused variables.

Re: [PATCH 4/8] Quiet GCC warnings about set but unused variables

2013-12-11 Thread Richard Braun
On Wed, Dec 11, 2013 at 05:30:43PM +0100, Marin Ramesa wrote: > - ipc_mqueue_t mqueue; > + ipc_mqueue_t mqueue = mqueue; /* Quiet GCC warning. */ Don't do that. Instead, tweak simple_unlock and similar functions this way : #define simple_unlock(l) ((void)(l)) -- Richard Braun

[PATCH 4/8] Quiet GCC warnings about set but unused variables

2013-12-11 Thread Marin Ramesa
This is the second way to quiet GCC warnings about set but unused variables during simple locks. The first one is here: http://lists.gnu.org/archive/html/bug-hurd/2013-12/msg6.html Third way would be to declare an set mqueue and obj only if MACH_SLOCKS. * ipc/ipc_port.c (ipc_port_set_seqno

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

[PATCH 63/66] vm/vm_page.h: remove unused variables

2013-12-05 Thread Marin Ramesa
* vm/vm_page.h (first_phys_addr, last_phys_addr): Remove unused variables. --- vm/vm_page.h | 5 - 1 file changed, 5 deletions(-) diff --git a/vm/vm_page.h b/vm/vm_page.h index 4536d1c..f5681d7 100644 --- a/vm/vm_page.h +++ b/vm/vm_page.h @@ -156,11 +156,6 @@ extern queue_head_t

[PATCH 58/66] kern/pc_sample.c: remove unused variables

2013-12-05 Thread Marin Ramesa
* kern/pc_sample.c (pc_sampling_enabled, pc_sampling_lock): Remove unused variables. --- kern/pc_sample.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/kern/pc_sample.c b/kern/pc_sample.c index 05c08b8..cdf8e95 100644 --- a/kern/pc_sample.c +++ b/kern/pc_sample.c @@ -43,9 +43,6

[PATCH 27/66] i386/i386/pit.c: remove unused variables

2013-12-05 Thread Marin Ramesa
* i386/i386/pit.c (pitctr1_port, pitctr2_port): Remove unused variables. --- i386/i386/pit.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/i386/i386/pit.c b/i386/i386/pit.c index 4f156d8..85929e9 100644 --- a/i386/i386/pit.c +++ b/i386/i386/pit.c @@ -57,8 +57,6 @@ WITH THE USE OR

[PATCH 26/66] i386/i386/pic.c: remove unused variables

2013-12-05 Thread Marin Ramesa
* i386/i386/pic.c (nintr, npics): Remove unused variables. --- i386/i386/pic.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/i386/i386/pic.c b/i386/i386/pic.c index 50ca150..75cb835 100644 --- a/i386/i386/pic.c +++ b/i386/i386/pic.c @@ -62,9 +62,6 @@ int curr_pic_mask; intiunit

[PATCH 29/66] i386/i386/trap.c: remove unused variables

2013-12-05 Thread Marin Ramesa
* i386/i386/trap.c (v86_assist_on, v86_unsafe_ok, v86_do_sti_cli, v86_do_sti_immediate, cli_count, sti_count): Remove unused variables. --- i386/i386/trap.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/i386/i386/trap.c b/i386/i386/trap.c index ffb23bb..239c853 100644 --- a

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

2013-12-02 Thread Marin Ramesa
y(l) (TRUE) /* always succeeds */ + +/* Quiet GCC warnings about + * set but unused variables during + * simple_unlock(). + */ +#define simple_unlock(l) (*l = *l) + +/* Quiet GCC warnings about + * set but unused variables during + * simple_lock_try(). Always succeeds. + */ +#def

Re: [PATCH 14/14] mach-defpager: remove unused variables

2013-11-09 Thread Samuel Thibault
Justus Winter, le Fri 08 Nov 2013 21:24:22 +0100, a écrit : > Found using the Clang Static Analyzer. > > * mach-defpager/default_pager.c (seqnos_memory_object_terminate): > Remove unused variables request_refs and name_refs. Ack > --- > mach-defpager/default_pager.c |

[PATCH 14/14] mach-defpager: remove unused variables

2013-11-08 Thread Justus Winter
Found using the Clang Static Analyzer. * mach-defpager/default_pager.c (seqnos_memory_object_terminate): Remove unused variables request_refs and name_refs. --- mach-defpager/default_pager.c |3 --- 1 file changed, 3 deletions(-) diff --git a/mach-defpager/default_pager.c b/mach-defpager

Re: mach-defpager/kalloc.c (kalloc_init): remove unused variables

2013-05-29 Thread Samuel Thibault
Miguel Figueiredo, le Sat 25 May 2013 11:54:47 +0100, a écrit : > 2013-05-14 Miguel Figueiredo > > * mach-defpager/kalloc.c (kalloc_init): remove unused variables Applied, thanks. > diff --git a/mach-defpager/kalloc.c b/mach-defpager/kalloc.c > index 8efb85f..2f42509 1006

Re: kern/thread.c (stack_alloc_hits, stack_alloc_misses): Remove unused variables

2013-05-29 Thread Samuel Thibault
Miguel Figueiredo, le Mon 27 May 2013 23:30:17 +0100, a écrit : > in case you feel it is worth it: I'm balanced. It is small enough not to have to really care about performance, and stuffing #if makes the code less readable. > diff --git a/kern/thread.c b/kern/thread.c > index 79f526a..574f184 10

Re: kern/thread.c (stack_alloc_hits, stack_alloc_misses): Remove unused variables

2013-05-27 Thread Miguel Figueiredo
Em 26-05-2013 22:39, Samuel Thibault escreveu: Miguel Figueiredo, le Sun 26 May 2013 18:28:55 +0100, a écrit : 2013-05-26 Miguel Figueiredo * kern/thread.c (stack_alloc_hits, stack_alloc_misses): Remove unused variables I wouldn't do that: they can be read from the debugger. Samuel

Re: kern/thread.c (stack_alloc_hits, stack_alloc_misses): Remove unused variables

2013-05-26 Thread Samuel Thibault
Miguel Figueiredo, le Sun 26 May 2013 18:28:55 +0100, a écrit : > 2013-05-26 Miguel Figueiredo > > * kern/thread.c (stack_alloc_hits, stack_alloc_misses): Remove unused > variables I wouldn't do that: they can be read from the debugger. Samuel

kern/thread.c (stack_alloc_hits, stack_alloc_misses): Remove unused variables

2013-05-26 Thread Miguel Figueiredo
2013-05-26 Miguel Figueiredo * kern/thread.c (stack_alloc_hits, stack_alloc_misses): Remove unused variables diff --git a/kern/thread.c b/kern/thread.c index 79f526a..2181d49 100644 --- a/kern/thread.c +++ b/kern/thread.c @@ -163,10 +163,8 @@ boolean_t stack_alloc_try( if (stack

mach-defpager/kalloc.c (kalloc_init): remove unused variables

2013-05-25 Thread Miguel Figueiredo
2013-05-14 Miguel Figueiredo * mach-defpager/kalloc.c (kalloc_init): remove unused variables diff --git a/mach-defpager/kalloc.c b/mach-defpager/kalloc.c index 8efb85f..2f42509 100644 --- a/mach-defpager/kalloc.c +++ b/mach-defpager/kalloc.c @@ -92,8 +92,6 @@ boolean_t

Re: unused variables

2013-05-13 Thread Samuel Thibault
Miguel Figueiredo, le Mon 13 May 2013 22:06:25 +0100, a écrit : > noticed a warning on unused variables: Indeed. Please see the GNU Changelog format in the GNU coding style, and the changelog entry I've written for the commit of your fix. Please provide it along your future patches. Samuel

unused variables

2013-05-13 Thread Miguel Figueiredo
Hi all, noticed a warning on unused variables: --- a/kern/slab.c +++ b/kern/slab.c @@ -1319,7 +1319,6 @@ void kalloc_init(void) { char name[KMEM_CACHE_NAME_SIZE]; size_t i, size; -vm_offset_t min, max; size = 1 << KALLOC_FIRST_SHIFT; -- Melhores cumprimentos/Best r

Re: [PATCH gnumach 4/6] Remove set but unused variables

2011-09-02 Thread Samuel Thibault
Guillem Jover, le Thu 01 Sep 2011 17:17:22 +0200, a écrit : > * linux/dev/drivers/block/floppy.c (setup_rw_floppy): Remove `dflags'. > (floppy_eject): Remove `dummy'. > * linux/src/drivers/net/8390.c (ethdev_init): Remove `ei_local'. > * linux/src/drivers/scsi/ppa.c (ppa_detect): Remove `ppb'. App

[PATCH gnumach 4/6] Remove set but unused variables

2011-09-01 Thread Guillem Jover
* linux/dev/drivers/block/floppy.c (setup_rw_floppy): Remove `dflags'. (floppy_eject): Remove `dummy'. * linux/src/drivers/net/8390.c (ethdev_init): Remove `ei_local'. * linux/src/drivers/scsi/ppa.c (ppa_detect): Remove `ppb'. --- linux/dev/drivers/block/floppy.c |6 ++ linux/src/drivers/n

Re: [PATCH 12/17] Disable unused variables

2011-08-26 Thread Samuel Thibault
Guillem Jover, le Thu 25 Aug 2011 15:22:35 +0200, a écrit : > * i386/i386at/com.c (comstart): Disable `i' variable. > * linux/src/drivers/net/at1700.c (net_close): Disable `lp' variable. > * linux/dev/include/linux/blk.h (end_request): Disable `nsect' variable > on MACH. Applied, thanks. Samuel

Re: [PATCH 11/17] Remove unused variables

2011-08-26 Thread Samuel Thibault
Guillem Jover, le Thu 25 Aug 2011 15:22:34 +0200, a écrit : > * vm/memory_object_proxy.c (memory_object_create_proxy): Remove unused > `kr' variable. > * linux/dev/glue/block.c (free_buffer): Remove unused `i' variable. > (register_blkdev): Remove unused `err' variable. > (unregister_blkdev): Likew

[PATCH 12/17] Disable unused variables

2011-08-25 Thread Guillem Jover
* i386/i386at/com.c (comstart): Disable `i' variable. * linux/src/drivers/net/at1700.c (net_close): Disable `lp' variable. * linux/dev/include/linux/blk.h (end_request): Disable `nsect' variable on MACH. --- i386/i386at/com.c |2 ++ linux/dev/include/linux/blk.h |2 ++ linux/

[PATCH 11/17] Remove unused variables

2011-08-25 Thread Guillem Jover
* vm/memory_object_proxy.c (memory_object_create_proxy): Remove unused `kr' variable. * linux/dev/glue/block.c (free_buffer): Remove unused `i' variable. (register_blkdev): Remove unused `err' variable. (unregister_blkdev): Likewise. (bread): Likewise. (init_partition): Likewise. * linux/dev/glue/n