Hi SCSI devs,
The patch 1da177e4c3f4: "Linux-2.6.12-rc2" from Apr 16, 2005, leads
to the following static checker warning:
drivers/scsi/aic7xxx/aic79xx_core.c:6440 ahd_init_scbdata() warn: integer
overflow (literal): u32max + 1
drivers/scsi/aic7xxx/aic79xx_core.c:6454 ahd_init_scbdata() warn: integer
overflow (literal): u32max + 1
drivers/scsi/aic7xxx/aic79xx_core.c:6473 ahd_init_scbdata() warn: integer
overflow (literal): u32max + 1
drivers/scsi/aic7xxx/aic79xx_core.c:7128 ahd_init() warn: integer overflow
(literal): u32max + 1
drivers/scsi/aic7xxx/aic7xxx_core.c:4807 ahc_init_scbdata() warn: integer
overflow (literal): u32max + 1
drivers/scsi/aic7xxx/aic7xxx_core.c:4839 ahc_init_scbdata() warn: integer
overflow (literal): u32max + 1
drivers/scsi/aic7xxx/aic7xxx_core.c:4871 ahc_init_scbdata() warn: integer
overflow (literal): u32max + 1
drivers/scsi/aic7xxx/aic7xxx_core.c:5362 ahc_init() warn: integer overflow
(literal): u32max + 1
drivers/scsi/aic7xxx/aic79xx_core.c
6419 /* Determine the number of hardware SCBs and initialize them */
6420 scb_data->maxhscbs = ahd_probe_scbs(ahd);
6421 if (scb_data->maxhscbs == 0) {
6422 printk("%s: No SCB space found\n", ahd_name(ahd));
6423 return (ENXIO);
6424 }
6425
6426 ahd_initialize_hscbs(ahd);
6427
6428 /*
6429 * Create our DMA tags. These tags define the kinds of device
6430 * accessible memory allocations and memory mappings we will
6431 * need to perform during normal operation.
6432 *
6433 * Unless we need to further restrict the allocation, we rely
6434 * on the restrictions of the parent dmat, hence the common
6435 * use of MAXADDR and MAXSIZE.
6436 */
6437
6438 /* DMA tag for our hardware scb structures */
6439 if (ahd_dma_tag_create(ahd, ahd->parent_dmat, /*alignment*/1,
6440 /*boundary*/BUS_SPACE_MAXADDR_32BIT + 1,
^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is UINT_MAX + 1, and we're passing it to a unsigned int type. I
have no idea what's going on... Probably no one cares, but I just
thought I would throw it out there in case anyone knows what was
intended.
6441 /*lowaddr*/BUS_SPACE_MAXADDR_32BIT,
6442 /*highaddr*/BUS_SPACE_MAXADDR,
6443 /*filter*/NULL, /*filterarg*/NULL,
6444 PAGE_SIZE, /*nsegments*/1,
6445 /*maxsegsz*/BUS_SPACE_MAXSIZE_32BIT,
6446 /*flags*/0, &scb_data->hscb_dmat) != 0) {
6447 goto error_exit;
6448 }
6449
6450 scb_data->init_level++;
6451
6452 /* DMA tag for our S/G structures. */
6453 if (ahd_dma_tag_create(ahd, ahd->parent_dmat, /*alignment*/8,
6454 /*boundary*/BUS_SPACE_MAXADDR_32BIT + 1,
6455 /*lowaddr*/BUS_SPACE_MAXADDR_32BIT,
6456 /*highaddr*/BUS_SPACE_MAXADDR,
6457 /*filter*/NULL, /*filterarg*/NULL,
6458 ahd_sglist_allocsize(ahd),
/*nsegments*/1,
6459 /*maxsegsz*/BUS_SPACE_MAXSIZE_32BIT,
6460 /*flags*/0, &scb_data->sg_dmat) != 0) {
6461 goto error_exit;
6462 }
regards,
dan carpenter