All of lore.kernel.org
 help / color / mirror / Atom feed
* Three if-clauses of constant logic value; char drivers for kernel 2.4.33.3
@ 2006-12-19 20:59 Mats Erik Andersson
  2006-12-29 22:16 ` Willy Tarreau
  2007-02-03 10:07 ` Willy Tarreau
  0 siblings, 2 replies; 3+ messages in thread
From: Mats Erik Andersson @ 2006-12-19 20:59 UTC (permalink / raw)
  To: linux-kernel

Hi there, all masters of kernel code,

I just discovered that the kernel code for 2.4.33.3 contains three
if-statements that never can change their values, whence they should
be repaired or eliminated. In source directory linux/drivers/char the
files vt.c and keyboard.c produce these warning upon compilation:

    vt.c:166: varning: comparison is always false due to limited range  
              of data type
    vt.c:289: varning: comparison is always false due to limited range
              of data type
    keyboard.c:640: varning: comparison is always true due to limited
                    range of data type

I did the compilation with gcc 3.3.5 on Debian Sarge. This behaviour
appeared first for kernel 2.2.19, since I wanted to revive the old
minirtl edition, but to my surprise the same warnings appear also
with the brand new kernel 2.4.33.3.

Best regards
             Mats Erik Andersson, PhD
             ynglingatal@yahoo.se
             mats.andersson64@comhem.se


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Three if-clauses of constant logic value; char drivers for kernel 2.4.33.3
  2006-12-19 20:59 Three if-clauses of constant logic value; char drivers for kernel 2.4.33.3 Mats Erik Andersson
@ 2006-12-29 22:16 ` Willy Tarreau
  2007-02-03 10:07 ` Willy Tarreau
  1 sibling, 0 replies; 3+ messages in thread
From: Willy Tarreau @ 2006-12-29 22:16 UTC (permalink / raw)
  To: Mats Erik Andersson; +Cc: linux-kernel

On Tue, Dec 19, 2006 at 09:59:37PM +0100, Mats Erik Andersson wrote:
> Hi there, all masters of kernel code,

Hi !

> I just discovered that the kernel code for 2.4.33.3 contains three
> if-statements that never can change their values, whence they should
> be repaired or eliminated. In source directory linux/drivers/char the
> files vt.c and keyboard.c produce these warning upon compilation:
> 
>     vt.c:166: varning: comparison is always false due to limited range  
>               of data type
>     vt.c:289: varning: comparison is always false due to limited range
>               of data type
>     keyboard.c:640: varning: comparison is always true due to limited
>                     range of data type
> 
> I did the compilation with gcc 3.3.5 on Debian Sarge. This behaviour
> appeared first for kernel 2.2.19, since I wanted to revive the old
> minirtl edition, but to my surprise the same warnings appear also
> with the brand new kernel 2.4.33.3.

OK thanks for reporting this. I'll take a look at those before next
release.

BTW, sorry, I missed your post. When posting 2.4-related mails, please
try to put the "2.4" word close to the beginning of the subject so that
my eyes can notice it in the middle of the 10000 other montly messages
on LKML.

> Best regards
>              Mats Erik Andersson, PhD
>              ynglingatal@yahoo.se
>              mats.andersson64@comhem.se

best regards,
Willy


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Three if-clauses of constant logic value; char drivers for kernel 2.4.33.3
  2006-12-19 20:59 Three if-clauses of constant logic value; char drivers for kernel 2.4.33.3 Mats Erik Andersson
  2006-12-29 22:16 ` Willy Tarreau
@ 2007-02-03 10:07 ` Willy Tarreau
  1 sibling, 0 replies; 3+ messages in thread
From: Willy Tarreau @ 2007-02-03 10:07 UTC (permalink / raw)
  To: Mats Erik Andersson; +Cc: linux-kernel

Hi Mats,

On Tue, Dec 19, 2006 at 09:59:37PM +0100, Mats Erik Andersson wrote:
> Hi there, all masters of kernel code,
> 
> I just discovered that the kernel code for 2.4.33.3 contains three
> if-statements that never can change their values, whence they should
> be repaired or eliminated. In source directory linux/drivers/char the
> files vt.c and keyboard.c produce these warning upon compilation:
> 
>     vt.c:166: varning: comparison is always false due to limited range  
>               of data type
>     vt.c:289: varning: comparison is always false due to limited range
>               of data type
>     keyboard.c:640: varning: comparison is always true due to limited
>                     range of data type
> 
> I did the compilation with gcc 3.3.5 on Debian Sarge. This behaviour
> appeared first for kernel 2.2.19, since I wanted to revive the old
> minirtl edition, but to my surprise the same warnings appear also
> with the brand new kernel 2.4.33.3.

I've looked at your warnings. They're all totally harmless, and caused
by safety checks against some defines in those functions. While in 2.6,
the two checks in vt.c have been removed, I can't be sure that nobody
in 2.4 changes the defines (eg: embedded systems) in which case the
checks would be totally valid.

So I will leave them. It may look annoying but it's a safe measure IMHO.

Best regards,
Willy


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-02-03 10:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-19 20:59 Three if-clauses of constant logic value; char drivers for kernel 2.4.33.3 Mats Erik Andersson
2006-12-29 22:16 ` Willy Tarreau
2007-02-03 10:07 ` Willy Tarreau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.