lkml.org 
[lkml]   [1998]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject2.1.82: ide-cd.c warning
Date
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 13:41    [W:0.043 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site