diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-11-13 17:34:01 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-01-18 14:12:33 -0500 |
commit | 0860bf94712f34f5920193004dfed25408f078b1 (patch) | |
tree | 56ca28016cb0edc1f3404fbcc23cf5747d9aac6f /Documentation/ko_KR | |
parent | 5807fcaa9bf7dd87241df739161c119cf78a6bc4 (diff) | |
download | linux-0860bf94712f34f5920193004dfed25408f078b1.tar.gz linux-0860bf94712f34f5920193004dfed25408f078b1.tar.bz2 linux-0860bf94712f34f5920193004dfed25408f078b1.zip |
ide: silence some underflow warnings
Back in the day we used to just say this code was root only so it was
ok that the bounds checking was sloppy. These days it annoys static
checkers so we fix it.
In the original code "c > INT_MAX" was never true since "c" was an int.
I am not sure what was intended so I left it alone. But because I made
"c" unsigned it means we don't have a warning any more.
The second warning is that we cap "i" but allow negatives leading to an
underflow of the ide_disks_chs[] array. The third set of warnings is
because these values come from the user and we cap most of the upper
bounds but allow negative values. Negative cylinders doesn't make
sense.
drivers/ide/ide.c:262 ide_set_disk_chs() warn: impossible condition '(c > ((~0 >> 1))) => (s32min-s32max > s32max)'
drivers/ide/ide.c:270 ide_set_disk_chs() warn: check 'ide_disks_chs[i]' for negative offsets 'i' = s32min. extra = 's32min-19'
drivers/ide/ide.c:271 ide_set_disk_chs() warn: no lower bound on 'h'
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation/ko_KR')
0 files changed, 0 insertions, 0 deletions