linux/drivers/ide
Dan Carpenter 0860bf9471 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>
2016-01-18 14:12:33 -05:00
..
aec62xx.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
ali14xx.c
alim15x3.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
amd74xx.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
atiixp.c Drivers: ide: Remove typedef atiixp_ide_timing 2014-10-15 14:27:38 -04:00
au1xxx-ide.c ide: drop owner assignment from platform_drivers 2014-10-20 16:20:38 +02:00
buddha.c zorro: ZTWO_VADDR() should return "void __iomem *" 2013-11-26 11:09:07 +01:00
cmd64x.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
cmd640.c
cs5520.c ide: remove deprecated use of pci api 2015-04-17 15:32:07 -04:00
cs5530.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
cs5535.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
cs5536.c ide: cs5536: use module_pci_driver() 2013-11-14 18:21:25 -05:00
cy82c693.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
delkin_cb.c drivers/ide/delkin_cb: Convert to module_pci_driver 2013-07-10 12:09:10 -07:00
dtc2278.c
falconide.c
gayle.c ide: drop owner assignment from platform_drivers 2014-10-20 16:20:38 +02:00
hpt366.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
ht6560b.c
icside.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
ide_platform.c ide: drop owner assignment from platform_drivers 2014-10-20 16:20:38 +02:00
ide-4drives.c
ide-acpi.c ACPI / bind: Move acpi_get_child() to drivers/ide/ide-acpi.c 2013-12-07 01:05:50 +01:00
ide-atapi.c mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM 2015-11-06 17:50:42 -08:00
ide-cd_ioctl.c mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM 2015-11-06 17:50:42 -08:00
ide-cd_verbose.c drivers: ide: Include appropriate header file in ide-cd_verbose.c 2014-01-28 23:35:09 -08:00
ide-cd.c mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM 2015-11-06 17:50:42 -08:00
ide-cd.h
ide-cs.c
ide-devsets.c mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM 2015-11-06 17:50:42 -08:00
ide-disk_ioctl.c
ide-disk_proc.c procfs: new helper - PDE_DATA(inode) 2013-04-09 14:13:32 -04:00
ide-disk.c mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM 2015-11-06 17:50:42 -08:00
ide-disk.h
ide-dma-sff.c
ide-dma.c
ide-eh.c block: move PM request support to IDE 2015-05-05 13:40:42 -06:00
ide-floppy_ioctl.c
ide-floppy_proc.c procfs: new helper - PDE_DATA(inode) 2013-04-09 14:13:32 -04:00
ide-floppy.c block: move REQ_TYPE_SENSE to the ide driver 2015-05-05 13:40:07 -06:00
ide-floppy.h
ide-gd.c drivers: avoid format string in dev_set_name 2013-07-03 16:07:41 -07:00
ide-gd.h
ide-generic.c
ide-io-std.c
ide-io.c block: move PM request support to IDE 2015-05-05 13:40:42 -06:00
ide-ioctls.c mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM 2015-11-06 17:50:42 -08:00
ide-iops.c
ide-legacy.c
ide-lib.c ide,ata: Rename ATA_IDX to ATA_SENSE 2015-03-27 11:59:22 -04:00
ide-park.c mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM 2015-11-06 17:50:42 -08:00
ide-pci-generic.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
ide-pio-blacklist.c drivers: ide: Include appropriate header file in ide-pio-blacklist.c 2014-01-28 23:35:09 -08:00
ide-pm.c mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM 2015-11-06 17:50:42 -08:00
ide-pnp.c PNP: ide/ide-pnp: Use module_pnp_driver to register driver 2015-03-18 22:39:17 +01:00
ide-probe.c ide,ata: Rename ATA_IDX to ATA_SENSE 2015-03-27 11:59:22 -04:00
ide-proc.c procfs: new helper - PDE_DATA(inode) 2013-04-09 14:13:32 -04:00
ide-scan-pci.c
ide-sysfs.c ide: convert bus code to use dev_groups 2013-10-16 18:40:57 -07:00
ide-tape.c mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM 2015-11-06 17:50:42 -08:00
ide-taskfile.c mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM 2015-11-06 17:50:42 -08:00
ide-timings.c
ide-xfer-mode.c
ide.c ide: silence some underflow warnings 2016-01-18 14:12:33 -05:00
it821x.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
it8172.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
it8213.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
jmicron.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
Kconfig Remove celleb-only SCC PATA drivers 2015-04-14 13:07:17 -04:00
macide.c
Makefile Remove celleb-only SCC PATA drivers 2015-04-14 13:07:17 -04:00
ns87415.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
opti621.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
palm_bk3710.c ide: drop owner assignment from platform_drivers 2014-10-20 16:20:38 +02:00
pdc202xx_new.c ide: pdc202xx_new: Replace timeval with ktime_t 2015-11-03 11:51:08 -05:00
pdc202xx_old.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
piix.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
pmac.c ide: remove deprecated use of pci api 2015-04-17 15:32:07 -04:00
q40ide.c
qd65xx.c
qd65xx.h
rapide.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
rz1000.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
sc1200.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
serverworks.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
setup-pci.c ide: remove deprecated use of pci api 2015-04-17 15:32:07 -04:00
sgiioc4.c ide: remove deprecated use of pci api 2015-04-17 15:32:07 -04:00
siimage.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
sis5513.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
sl82c105.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
slc90e66.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
tc86c001.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
triflex.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
trm290.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
tx4938ide.c ide: drop owner assignment from platform_drivers 2014-10-20 16:20:38 +02:00
tx4939ide.c ide: drop owner assignment from platform_drivers 2014-10-20 16:20:38 +02:00
umc8672.c
via82cxxx.c Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00