lkml.org 
[lkml]   [1998]   [Jan]   [27]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
From"Mike Black" <>
Subject2.1.82: ide-cd.c warning
DateTue, 27 Jan 1998 09:37:51 -0500
gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fom
it-frame-pointer -pipe -fno-strength-reduce -m486 -malig
n-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=586   -c -o ide-cd.o
ide-cd.c
ide-cd.c: In function `cdrom_analyze_sense_data':
ide-cd.c:275: warning: comparison is always 1 due to limited range of data
type
gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fom
it-frame-p

275:
                if (reqbuf->sense_key >= 0 &&
                    reqbuf->sense_key < ARY_LEN (sense_key_texts))

sense_key is:

        unsigned char sense_key  : 4;


Should the code be (to force it to an int):


                if (reqbuf->sense_key & 0x0f >= 0 &&
                    reqbuf->sense_key < ARY_LEN (sense_key_texts))
This does clear up the warning.


\
 
 \ /
  Last update: 2005-03-22 12:41    [W:0.054 / U:0.040 seconds]
©2003-2008 Jasper Spaans