bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Samuel Thibault
Subject: Re: [PATCH 42/66] i386/i386at/lpr.c: remove uninitialized variable
Date: Mon, 9 Dec 2013 00:11:19 +0900
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

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 initialized
> to all zero.
> 
> It's not so clear from the code.
> 
> * i386/i386at/lpr.c (lpr_alive): Remove variable.
> Remove the if.
> 
> ---
>  i386/i386at/lpr.c | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/i386/i386at/lpr.c b/i386/i386at/lpr.c
> index 557eb15..e580da9 100644
> --- a/i386/i386at/lpr.c
> +++ b/i386/i386at/lpr.c
> @@ -67,8 +67,6 @@ struct bus_driver lprdriver = {
>  
>  struct tty   lpr_tty[NLPR];
>  
> -int lpr_alive[NLPR];
> -
>  int
>  lprprobe(port, dev)
>  struct bus_device *dev;
> @@ -85,14 +83,7 @@ struct bus_device *dev;
>       outb(INTR_ENAB(addr),0x07);
>       outb(DATA(addr),0xaa);
>       ret = inb(DATA(addr)) == 0xaa;
> -     if (ret) {
> -             if (lpr_alive[unit]) {
> -                     printf("lpr: Multiple alive entries for unit %d.\n", 
> unit);
> -                     printf("lpr: Ignoring entry with address = %x .\n", 
> addr);
> -                     ret = 0;
> -             } else
> -                     lpr_alive[unit]++;
> -     }
> +
>       return(ret);
>  }
>  
> -- 
> 1.8.1.4
> 
> 

-- 
Samuel
/*
 * [...] Note that 120 sec is defined in the protocol as the maximum
 * possible RTT.  I guess we'll have to use something other than TCP
 * to talk to the University of Mars.
 * PAWS allows us longer timeouts and large windows, so once implemented
 * ftp to mars will work nicely.
 */
(from /usr/src/linux/net/inet/tcp.c, concerning RTT [retransmission timeout])



reply via email to

[Prev in Thread] Current Thread [Next in Thread]